Compare commits

...

12 Commits

Author SHA1 Message Date
DiMing a58dd42df8 excel 导出忽略列
6 years ago
DiMing 22864a3abe readme
6 years ago
DiMing e611695ccb AddRazorRuntimeCompilation
6 years ago
DiMing 2251854fc8 CheckNull
6 years ago
DiMing 296addffbc dict
6 years ago
DiMing 97080520b0 orm base
6 years ago
DiMing 2c70d6eda2 BaseServices
6 years ago
DiMing d5b2a6c461 Nlog
6 years ago
DiMing a3095e3036 InvertoryMove
6 years ago
DiMing c474163ec0 修复分页,vue 定义需为app
6 years ago
DiMing 35a2efe67f vscode
6 years ago
DiMing a8e679296a netcore2.2 to netcore3.0
6 years ago

@ -0,0 +1,34 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/KopSoftWms/bin/Debug/netcoreapp3.0/KopSoftWms.dll",
"args": [],
"cwd": "${workspaceFolder}/src/KopSoftWms",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

36
.vscode/tasks.json vendored

@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/KopSoftWms/KopSoftWms.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/KopSoftWms/KopSoftWms.csproj"
],
"problemMatcher": "$tsc"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/src/KopSoftWms/KopSoftWms.csproj"
],
"problemMatcher": "$tsc"
}
]
}

@ -1,16 +1,23 @@
[![Build Status](https://lysilver.visualstudio.com/kopsoftwms/_apis/build/status/lysilver.KopSoftWms?branchName=master)](https://lysilver.visualstudio.com/kopsoftwms/_build/latest?definitionId=3&branchName=master)
****
* KopSoftPrint标签打印软件 http://mes.kopsoft.cn/KopSoftPrint/
* KopSoft标签打印软件 http://tuoshui.net.cn/Print/
* GitHub https://github.com/williamyang1984/KopSoftPrint
* 码云 https://gitee.com/williamyang1984/KopSoftPrint
****
* KopSoftWms仓库管理系统 http://wms.kopsoft.cn/
*
* KopSoft仓库管理系统 http://wms.kopsoft.cn/
* GitHub https://github.com/lysilver/KopSoftWms
* 码云 https://gitee.com/yulou/KopSoftWms
*
* 技术QQ群 421635
* 技术论坛 http://tangqiao.net.cn/forum.php?mod=forumdisplay&fid=47
****
* KopSoftMes制造执行系统 http://mes.kopsoft.cn/
****
| 版本 | 分支 |
| ---- | ---- |
| netcore2.2 | master |
| netcore3.0 | netcore3.0 |
| netcore3.1 | netcore3.1 |
## 功能模块
- [x] 用户管理
@ -35,15 +42,15 @@
## 技术
`core 2.2`
`net core`
* 基于.Net Core 2.2开发;
* 基于.Net Core 2.2~3.1开发;
* 支持sqlserver、mysql数据库其他数据库未测试脚本在docs/sql
* 前端采用 vue、polyfill、qs、 axios、 bootstrap、adminlte、layer、bootstrap-datetimepicker、bootstrap-table、bootstrap-select等
* 后端采用 asp.net mvc core 2.2、sqlsugar、fluentValidation、nlog、Jil、DI、Ganss、雪花算法、Xunit、npoi因在linux上报错后期替换掉bug修复https://www.cnblogs.com/Robbery/p/10115234.html
* 后端采用 asp.net mvc core、sqlsugar、fluentValidation、nlog、Jil、DI、Ganss、雪花算法、Xunit、npoi因在linux上报错后期替换掉bug修复https://www.cnblogs.com/Robbery/p/10115234.html

@ -1,8 +1,8 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
WORKDIR /app
EXPOSE 5000
FROM microsoft/dotnet:2.2-sdk AS build
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
WORKDIR /src
COPY ["KopSoftWms/KopSoftWms.csproj", "KopSoftWms/"]
COPY ["Orm/Orm.csproj", "Orm/"]

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -7,10 +7,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.4.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="8.4.0" />
<PackageReference Include="FluentValidation" Version="8.5.1" />
<PackageReference Include="FluentValidation.AspNetCore" Version="8.5.1" />
<PackageReference Include="MediatR" Version="7.0.0" />
<PackageReference Include="sqlSugarCore" Version="4.9.9.10" />
<PackageReference Include="sqlSugarCore" Version="5.0.0.10" />
</ItemGroup>
</Project>

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using YL.NetCore;
using YL.Utils.Table;
@ -13,7 +14,11 @@ namespace IRepository
{
#region add
bool Insert(T t);
bool Insert(T t, bool IgnoreNullColumn = true);
bool InsertIgnoreNullColumn(T t);
bool InsertIgnoreNullColumn(T t, params string[] columns);
bool Insert(SqlSugarClient client, T t);
@ -21,6 +26,10 @@ namespace IRepository
bool Insert(List<T> t);
bool InsertIgnoreNullColumn(List<T> t);
bool InsertIgnoreNullColumn(List<T> t, params string[] columns);
DbResult<bool> InsertTran(T t);
DbResult<bool> InsertTran(List<T> t);
@ -96,6 +105,8 @@ namespace IRepository
List<T> QueryableToList(Expression<Func<T, bool>> expression);
Task<List<T>> QueryableToListAsync(Expression<Func<T, bool>> expression);
string QueryableToJson(string select, Expression<Func<T, bool>> expressionWhere);
List<T> QueryableToList(string tableName);

@ -6,11 +6,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="sqlSugarCore" Version="4.9.9.10" />
<PackageReference Include="sqlSugarCore" Version="5.0.0.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Entity\Entity.csproj" />
<ProjectReference Include="..\NetCore\YL.NetCore.csproj" />
<ProjectReference Include="..\YL.Utils\YL.Utils.csproj" />
</ItemGroup>
</Project>

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using YL.NetCore;
using YL.Utils.Table;
@ -13,7 +14,11 @@ namespace IServices
{
#region add
bool Insert(T t);
bool Insert(T t, bool IgnoreNullColumn = true);
bool InsertIgnoreNullColumn(T t);
bool InsertIgnoreNullColumn(T t, params string[] columns);
bool Insert(SqlSugarClient client, T t);
@ -21,6 +26,10 @@ namespace IServices
bool Insert(List<T> t);
bool InsertIgnoreNullColumn(List<T> t);
bool InsertIgnoreNullColumn(List<T> t, params string[] columns);
DbResult<bool> InsertTran(T t);
DbResult<bool> InsertTran(List<T> t);
@ -83,6 +92,8 @@ namespace IServices
List<T> QueryableToList(Expression<Func<T, bool>> expression);
Task<List<T>> QueryableToListAsync(Expression<Func<T, bool>> expression);
string QueryableToJson(string select, Expression<Func<T, bool>> expressionWhere);
List<T> QueryableToList(string tableName);

@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="sqlSugarCore" Version="4.9.9.10" />
<PackageReference Include="sqlSugarCore" Version="5.0.0.10" />
</ItemGroup>
<ItemGroup>

@ -22,6 +22,10 @@ namespace YL.NetCore.Attributes
var viewData = (context.Controller as Controller)?.ViewData;
var viewBag = (context.Controller as Controller)?.ViewBag;
var services = context.HttpContext.RequestServices;
//var log = services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
//ILogger<CheckMenuAttribute> logger = log.CreateLogger<CheckMenuAttribute>();
//logger.LogInformation("");
var properties = context.ActionDescriptor.Properties;
var claims = context.HttpContext.User?.Claims;
var cache = services.GetService(typeof(IMemoryCache)) as IMemoryCache;
@ -37,8 +41,7 @@ namespace YL.NetCore.Attributes
}
if (viewBag != null)
{
viewBag.keywords = properties["keywords"].ToString();
viewBag.description = properties["description"].ToString();
viewBag.title = properties["title"].ToString();
viewBag.company = properties["company"].ToString();
viewBag.customer = properties["customer"].ToString();
viewBag.nickname = claims.SingleOrDefault(c => c.Type == ClaimTypes.Name).Value;

@ -38,6 +38,16 @@ namespace KopSoftWms.Controllers
{
//TempData["returnUrl"] = returnUrl;
//_userServices.Login(UserDtoCache.UserId, GetIp());
//_mediator.Publish(new Sys_log
//{
// LogId = PubId.SnowflakeId,
// Browser = GetBrowser(),
// CreateBy = UserDtoCache.UserId,
// Description = $"{UserDtoCache.UserNickname}登录成功",
// LogIp = GetIp(),
// Url = GetUrl(),
// LogType = LogType.login.EnumToString(),
//});
//_logServices.Insert(new Sys_log
//{
// LogId = PubId.SnowflakeId,
@ -48,16 +58,15 @@ namespace KopSoftWms.Controllers
// Url = GetUrl(),
// LogType = LogType.login.EnumToString(),
//});
ViewBag.keywords = GetDescriptor("keywords");
ViewBag.description = GetDescriptor("description");
ViewBag.title = GetDescriptor("title");
ViewBag.company = GetDescriptor("company");
ViewBag.customer = GetDescriptor("customer");
ViewBag.nickname = UserDtoCache.UserNickname;
ViewBag.headimg = UserDtoCache.HeadImg;
ViewBag.nickname = UserDtoCache?.UserNickname;
ViewBag.headimg = UserDtoCache?.HeadImg;
//菜单
////菜单
var menus = _roleServices.GetMenu(UserDtoCache.RoleId.Value);
GetMemoryCache.Set("menu_" + UserDtoCache.UserId, menus);
GetMemoryCache.Set("menu_" + UserDtoCache?.UserId, menus);
ViewData["menu"] = menus;
return View();
}
@ -84,7 +93,7 @@ namespace KopSoftWms.Controllers
public IActionResult Welcome()
{
//ViewBag.keywords = GetDescriptor("keywords");
ViewBag.title = GetDescriptor("title");
return View();
}

@ -46,15 +46,15 @@ namespace KopSoftWms.Controllers
[AllowAnonymous]
public IActionResult Index()
{
//HttpContext.Request.EnableRewind();
//TempData["returnUrl"] = returnUrl;
ViewBag.keywords = GetDescriptor("keywords");
ViewBag.description = GetDescriptor("description");
ViewBag.title = GetDescriptor("title");
ViewBag.company = GetDescriptor("company");
ViewBag.customer = GetDescriptor("customer");
return View();
}
[Route("Login/CheckLoginAsync")]
[HttpPost]
[AllowAnonymous]
public async Task<IActionResult> CheckLoginAsync([FromBody]SysUserDto sys)
@ -112,6 +112,15 @@ namespace KopSoftWms.Controllers
Url = GetUrl(),
LogType = LogType.login.EnumToString()
});
//_logServices.Insert(new Sys_log
//{
// LogId = PubId.SnowflakeId,
// Browser = GetBrowser(),
// Description = $"{_xss.Filter(sys.UserNickname)}登录失败",
// LogIp = GetIp(),
// Url = GetUrl(),
// LogType = LogType.login.EnumToString()
//});
}
item.Item3 = null;
//return Json(item);

@ -1,4 +1,5 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
#FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
WORKDIR /app
EXPOSE 5000

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TypeScriptToolsVersion>3.0</TypeScriptToolsVersion>
<LangVersion>7.1</LangVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
@ -9,11 +9,6 @@
<ItemGroup>
<Content Remove="bundleconfig.json" />
<Content Remove="wwwroot\js\vqypa.min.js" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\js\vqypa.min.js" />
</ItemGroup>
<ItemGroup>
@ -26,14 +21,12 @@
<None Include="wwwroot\fonts\fontawesome-webfont.woff2" />
<None Include="wwwroot\js\locales\bootstrap-datetimepicker.zh-CN.js" />
<None Include="wwwroot\js\locales\bootstrap-datetimepicker.zh-TW.js" />
<None Include="wwwroot\js\vqypa.min.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.8" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0.3" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="Pomelo.AspNetCore.TimedJob" Version="2.0.0-rtm-10046" />
</ItemGroup>

@ -7,13 +7,16 @@
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
${local-ip} ${aspnet-request-ip}
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="variable1" value="${newline}date ${date}${newline}level ${level}${newline}logger ${logger}${newline}machinename ${machinename}
${newline}message ${message} ${newline}exception${exception}
${newline}clientip${local-ip}${newline}message ${message} ${newline}exception${exception}
${newline}appdomain ${appdomain}${newline}assembly-version ${assembly-version}${newline}basedir ${basedir}
${newline}callsite ${callsite}${newline}callsite-linenumber ${callsite-linenumber}${newline}counter ${counter}${newline}nlogdir ${nlogdir}
${newline}processid ${processid}${newline}processname ${processname}${newline}specialfolder ${specialfolder}
${newline}processid ${processid}${newline}processname ${processname}
${newline}traceid ${aspnet-traceidentifier}
${newline}specialfolder ${specialfolder}
${newline}stacktrace: ${stacktrace}${newline}-----------------------------------------------------------" />
<variable name="variable2" value="日志时间:${longdate}${newline}日志来源:${callsite}${newline}日志级别:${uppercase:${level}}${newline}消息内容:${message}${newline}异常信息:${exception}${newline}stacktrace: ${stacktrace}${newline}==============================================================${newline}" />
<!--
@ -25,7 +28,11 @@ ${newline}stacktrace: ${stacktrace}${newline}-----------------------------------
Write events to a file with the date in the filename. -->
<!--<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />-->
<target name="log_file" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log" layout="${variable1}" />
<target name="log_file" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
<target xsi:type="File" fileName="${basedir}/logs/${shortdate}/${shortdate}.${level}.log"
layout="${variable1}" archiveAboveSize="2097152" archiveEvery="Day" />
</target>
<!--<target name="log_file" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log" layout="${variable1}" />-->
<target name="log_file2" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log" layout="${variable2}" />
</targets>
@ -36,7 +43,7 @@ ${newline}stacktrace: ${stacktrace}${newline}-----------------------------------
-->
<!--<logger name="*" minlevel="Debug" writeTo="f" />-->
<logger name="*" minlevel="Debug" writeTo="log_file" />
<logger name="*" minlevel="Info" writeTo="log_file2" />
<!--<logger name="*" minlevel="Info" writeTo="log_file2" />-->
<!--<logger name="*" writeTo="log_file2" />-->
</rules>
</nlog>

@ -1,5 +1,5 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using YL.Utils.Configs;
namespace YL
@ -11,19 +11,25 @@ namespace YL
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
public static IHostBuilder CreateWebHostBuilder(string[] args)
{
var config = ConfigUtil.GetConfiguration;
if (string.IsNullOrWhiteSpace(config["urls"]))
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
else
{
return WebHost.CreateDefaultBuilder(args)
.UseConfiguration(ConfigUtil.GetConfiguration)
.UseStartup<Startup>();
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseConfiguration(ConfigUtil.GetConfiguration);
webBuilder.UseStartup<Startup>();
});
}
}
}

@ -1,16 +1,16 @@
using IRepository;
using IServices;
using MediatR;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Repository;
using Services;
using SqlSugar;
using System;
using System.Text;
using YL.Core.Orm.SqlSugar;
using YL.NetCore.Attributes;
@ -18,10 +18,6 @@ using YL.NetCore.Conventions;
using YL.NetCore.DI;
using YL.NetCoreApp.Extensions;
using YL.Utils.Json;
using MediatR;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
namespace YL
{
@ -41,18 +37,27 @@ namespace YL
{
option.Filters.Add<BaseExceptionAttribute>();
//option.Filters.Add<FilterXSSAttribute>();
option.Conventions.Add(new ApplicationDescription("keywords", Configuration["sys:keywords"]));
option.Conventions.Add(new ApplicationDescription("description", Configuration["sys:description"]));
option.Conventions.Add(new ApplicationDescription("title", Configuration["sys:title"]));
option.Conventions.Add(new ApplicationDescription("company", Configuration["sys:company"]));
option.Conventions.Add(new ApplicationDescription("customer", Configuration["sys:customer"]));
}).SetCompatibilityVersion(CompatibilityVersion.Latest);
services.AddControllersWithViews();
services.AddRazorPages().AddRazorRuntimeCompilation();
//services.AddControllersWithViews(option =>
//{
// option.Filters.Add<BaseExceptionAttribute>();
// //option.Filters.Add<FilterXSSAttribute>();
// option.Conventions.Add(new ApplicationDescription("title", Configuration["sys:title"]));
// option.Conventions.Add(new ApplicationDescription("company", Configuration["sys:company"]));
// option.Conventions.Add(new ApplicationDescription("customer", Configuration["sys:customer"]));
//});
//services.Configure<CookiePolicyOptions>(options =>
//{
// // This lambda determines whether user consent for non-essential cookies is needed for a given request.
// options.CheckConsentNeeded = context => true;
// options.MinimumSameSitePolicy = SameSiteMode.None;
//});
services.AddTimedJob();
// services.AddTimedJob();
services.AddOptions();
services.AddXsrf();
services.AddXss();
@ -84,7 +89,6 @@ namespace YL
{
o.JsonType = JsonType.Jil;
});
services.AddDIProperty();
services.AddHttpContextAccessor();
services.AddHtmlEncoder();
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@ -98,8 +102,8 @@ namespace YL
RegisterBase(services);
ServiceExtension.RegisterAssembly(services, "Services");
ServiceExtension.RegisterAssembly(services, "Repository");
var bulid = services.BuildServiceProvider();
ServiceResolve.SetServiceResolve(bulid);
//var bulid = services.BuildServiceProvider();
//ServiceResolve.SetServiceResolve(bulid);
}
/// <summary>
@ -129,7 +133,7 @@ namespace YL
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
@ -139,28 +143,31 @@ namespace YL
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles(); //使用静态文件
app.UseGlobalCore();
app.UseExecuteTime();
app.UseTimedJob();
// app.UseTimedJob();
app.UseResponseCompression(); //使用压缩
app.UseResponseCaching(); //使用缓存
app.UseStaticFiles(); //使用静态文件
app.UseCookiePolicy();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseStatusCodePagesWithRedirects("/Home/Error/{0}");
app.UseMvc(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRoute(
name: "default",
template: "{controller=Login}/{action=Index}/{id?}");
// Areas
routes.MapRoute(
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapAreaControllerRoute(
name: "areas",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"
);
areaName: "areas",
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
endpoints.MapRazorPages();
});
}
}

@ -67,6 +67,14 @@
datemax: '',
DictType: ''
},
computed: {
qParams: function () {
var data = {
DictType: this.DictType
};
return data;
}
},
//beforeCreate: function () {
// this.$nextTick(function () {
// this.$refs.Dict.parentNode.parentNode.classList.add("active");
@ -176,7 +184,7 @@
var qParams = {
DictType: _self.DictType
};
yui.table("bootstraptable", "/Dict/List", obj, "POST", "DictId", true, qParams);
yui.table("bootstraptable", "/Dict/List", obj, "POST", "DictId", true, this.qParams);
},
showL: function () {
yui.layershow("添加字典", "/Dict/Add", 510, 400);

@ -539,7 +539,7 @@
if (arr.length > 0) {
var index = layer.confirm("您确定要删除吗?", { btn: ["确定", "取消"] }, function () {
var id = arr[0].InventorymoveId;
yui.$axiosget('/InventoryMoveId/Delete?id=' + id)
yui.$axiosget('/InventoryMove/Delete?id=' + id)
.then(function (response) {
if (response.data.Item1) {
layer.msg(response.data.Item2 || errorMsg, { icon: 1 });

@ -72,8 +72,8 @@
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
</button>
@*<button id="btn_auditin" v-on:click="auditinL" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span>审核
</button>*@
<span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span>审核
</button>*@
<button id="btn_delete" v-on:click="deleteL" type="button" class="btn btn-default">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
</button>
@ -98,6 +98,15 @@
stockInList: [],
stockInDList: [],
},
computed: {
qParams: function () {
var data = {
StockInStatus: this.StockInStatus,
StockInType: this.StockInType
};
return data;
}
},
mounted: function () {
var _self = this;
_self.$nextTick(function () {
@ -392,7 +401,7 @@
}
}];
yui.table2("bootstraptable", "/StockIn/List", "/StockIn/ListDetail", obj, objSub, "POST", "StockInId", "StockInId", true, qParams);
yui.table2("bootstraptable", "/StockIn/List", "/StockIn/ListDetail", obj, objSub, "POST", "StockInId", "StockInId", true, _self.qParams);
//yui.table("bootstraptable", "/StockIn/List", obj, "POST", "StockInId", true, qParams);
},
showL: function () {

@ -98,6 +98,15 @@
stockOutList: [],
stockOutDList: [],
},
computed: {
qParams: function () {
var data = {
StockOutStatus: _self.StockOutStatus,
StockOutType: _self.StockOutType
};
return data;
}
},
mounted: function () {
var _self = this;
_self.$nextTick(function () {
@ -396,7 +405,7 @@
}
}];
yui.table2("bootstraptable", "/StockOut/List", "/StockOut/ListDetail", obj, objSub, "POST", "StockOutId", "StockOutId", true, qParams);
yui.table2("bootstraptable", "/StockOut/List", "/StockOut/ListDetail", obj, objSub, "POST", "StockOutId", "StockOutId", true, _self.qParams);
//yui.table("bootstraptable", "/StockIn/List", obj, "POST", "StockInId", true, qParams);
},
showL: function () {

@ -1,9 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

@ -1,7 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning"
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"urls": "", //http://*:9099;http://*:9098 "" Kestrel
@ -25,7 +27,8 @@
"keywords": "二维码标签打印软件,WMS仓库管理系统,ERP企业资源计划,日化MES制造执行系统,SCADA数据采集与监控",
"description": "工业信息化自动化解决方案",
"company": "KopSoft",
"customer": "KopSoftWms仓库管理系统"
"customer": "KopSoftWms仓库管理系统",
"title":"KopSoftWms仓库管理系统"
},
"Des": {
"Project": "技术栈",

File diff suppressed because one or more lines are too long

@ -419,7 +419,8 @@
temp.datemin = _self.$refs.datemin.value;
temp.datemax = _self.$refs.datemax.value;
}
return yui.extend(temp, qParams);
return yui.extend(temp, app.qParams);
//return yui.extend(temp, qParams);
//return $.extend(temp, qParams);
},
queryParamsType: 'limit',
@ -487,7 +488,7 @@
temp.datemin = _self.$refs.datemin.value;
temp.datemax = _self.$refs.datemax.value;
}
return yui.extend(temp, qParams);
return yui.extend(temp, app.qParams);
//return $.extend(temp, qParams);
},
//queryParams: function (params) {
@ -568,7 +569,7 @@
temp.datemin = _self.$refs.datemin.value;
temp.datemax = _self.$refs.datemax.value;
}
return yui.extend(temp, qParams);
return yui.extend(temp, app.qParams);
//return $.extend(temp, qParams);
},
//queryParams: function (params) {

File diff suppressed because one or more lines are too long

@ -8,15 +8,37 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.2" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<Compile Remove="Autofac\**" />
<Compile Remove="Conventions\**" />
<Compile Remove="DI\**" />
<Compile Remove="HtmlExtensions\**" />
<Compile Remove="Middlewares\**" />
<EmbeddedResource Remove="Autofac\**" />
<EmbeddedResource Remove="Conventions\**" />
<EmbeddedResource Remove="DI\**" />
<EmbeddedResource Remove="HtmlExtensions\**" />
<EmbeddedResource Remove="Middlewares\**" />
<None Remove="Autofac\**" />
<None Remove="Conventions\**" />
<None Remove="DI\**" />
<None Remove="HtmlExtensions\**" />
<None Remove="Middlewares\**" />
</ItemGroup>
<ItemGroup>
<Compile Include="Autofac\AutofacConfig.cs" />
<Compile Include="Autofac\AutofacResolver.cs" />
<Compile Include="Autofac\ContainerManager.cs" />
<Compile Include="Autofac\IResolver.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.0.1" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.5.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.6.0" />
</ItemGroup>
<ItemGroup>

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
@ -14,14 +15,9 @@ using System.Text.Encodings.Web;
using System.Text.Unicode;
using YL.Utils.Check;
using YL.Utils.Extensions;
using YL.Utils.Json;
using YL.Utils.Log;
using YL.Utils.Security;
using YL.Utils.Json;
using System;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.DependencyInjection.Extensions;
using YL.NetCore.DI;
using Microsoft.AspNetCore.Mvc.Filters;
namespace YL.NetCoreApp.Extensions
{
@ -58,7 +54,8 @@ namespace YL.NetCoreApp.Extensions
public static IServiceCollection AddContextFactory(this IServiceCollection services)
{
return services.AddSingleton<IHttpContextFactory, HttpContextFactory>();
//HttpContextFactory
return services.AddSingleton<IHttpContextFactory, DefaultHttpContextFactory>();
}
/// <summary>
@ -301,13 +298,5 @@ namespace YL.NetCoreApp.Extensions
return services.AddTransient(typeof(Lazy<>));
}
}
public static IServiceCollection AddDIProperty(this IServiceCollection services)
{
//替换控制器构建者类实现控制器和Filter类属性注入功能
services.Replace(ServiceDescriptor.Transient<IControllerActivator, PropertiesAutowiredControllerActivator>());
services.Replace(ServiceDescriptor.Transient<IFilterProvider, PropertiesAutowiredFilterProvider>());
return services;
}
}
}

@ -1,10 +1,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using YL.Utils.Log;
namespace YL.NetCore.Middlewares
{
@ -34,7 +31,8 @@ namespace YL.NetCore.Middlewares
private async Task<string> FormatRequest(HttpRequest request)
{
request.EnableRewind();
//request.EnableRewind();
request.EnableBuffering();
request.Body.Seek(0, SeekOrigin.Begin);
var text = await new StreamReader(request.Body).ReadToEndAsync();
request.Body.Seek(0, SeekOrigin.Begin);

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>YL.NetCoreApp</RootNamespace>
<AssemblyName>YL.NetCoreApp</AssemblyName>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.2.0" />
<None Remove="DI\PropertiesAutowiredControllerActivator.txt" />
<None Remove="DI\PropertiesAutowiredFilterProvider.txt" />
</ItemGroup>
<ItemGroup>

@ -31,9 +31,9 @@ namespace YL.NetCore.NetCoreApp
{
private IMemoryCache _memory;
private IConfiguration _configuration;
public string AppRoot { get { return CreateService<IHostingEnvironment>().ContentRootPath; } }
public string AppRoot { get { return CreateService<IWebHostEnvironment>().ContentRootPath; } }
public string WebRoot { get { return CreateService<IHostingEnvironment>().WebRootPath; } }
public string WebRoot { get { return CreateService<IWebHostEnvironment>().WebRootPath; } }
protected IMemoryCache GetMemoryCache
{
@ -227,7 +227,7 @@ namespace YL.NetCore.NetCoreApp
var req = HttpContext.Request;
return $"{req.Scheme}://{req.Host}{req.PathBase}{req.Path}{req.QueryString}";
}
protected virtual string GetDisplayUrl()
{
return UriHelper.GetDisplayUrl(HttpContext.Request);
@ -240,7 +240,7 @@ namespace YL.NetCore.NetCoreApp
protected virtual string GetEncodedUrl()
{
return UriHelper.GetEncodedUrl(HttpContext.Request);
return UriHelper.GetEncodedUrl(HttpContext.Request);
}
protected virtual string GetBrowser()

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.60.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="sqlSugarCore" Version="4.9.9.10" />
<PackageReference Include="Dapper" Version="2.0.30" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageReference Include="sqlSugarCore" Version="5.0.0.10" />
</ItemGroup>
<ItemGroup>

@ -76,19 +76,28 @@ namespace YL.Core.Orm.SqlSugar
if (flag.Equals("true", StringComparison.OrdinalIgnoreCase))
{
db.Ado.IsEnableLogEvent = true;
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
log.Info(sql);
};
//SQL执行前事件
db.Aop.OnLogExecuting = (sql, pars) =>
{
log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行前SQL: {sql}");
//log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
};
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行后SQL: {sql}");
};
db.Aop.OnError = (exp) =>//执行SQL 错误事件
{
log.Debug(exp.Message);
log.Debug(exp, exp.Sql);
};
}
else
@ -126,19 +135,28 @@ namespace YL.Core.Orm.SqlSugar
if (flag.Equals("true", StringComparison.OrdinalIgnoreCase))
{
db.Ado.IsEnableLogEvent = true;
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
log.Info(sql);
};
//SQL执行前事件
db.Aop.OnLogExecuting = (sql, pars) =>
{
log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行前SQL: {sql}");
//log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
};
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行后SQL: {sql}");
};
db.Aop.OnError = (exp) =>//执行SQL 错误事件
{
log.Debug(exp.Message + ";;" + exp.Sql);
log.Debug(exp, exp.Sql);
};
}
else
@ -175,19 +193,28 @@ namespace YL.Core.Orm.SqlSugar
if (flag.Equals("true", StringComparison.OrdinalIgnoreCase))
{
db.Ado.IsEnableLogEvent = true;
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
log.Info(sql);
};
//SQL执行前事件
db.Aop.OnLogExecuting = (sql, pars) =>
{
log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行前SQL: {sql}");
//log.Info(db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
};
//SQL执行完事件
db.Aop.OnLogExecuted = (sql, pars) =>
{
foreach (var item in pars)
{
sql = sql.Replace(item.ParameterName.ToString(), $"'{item.Value?.ToString()}'");
}
log.Info($"执行后SQL: {sql}");
};
db.Aop.OnError = (exp) =>//执行SQL 错误事件
{
log.Debug(exp.Message);
log.Debug(exp, exp.Sql);
};
}
else

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using YL.Utils.Extensions;
using YL.Utils.Json;
using YL.Utils.Table;
@ -22,9 +23,19 @@ namespace Repository
#region add
public bool Insert(T t)
public bool Insert(T t, bool IgnoreNullColumn = true)
{
return _db.Insertable(t).ExecuteCommand() > 0;
return _db.Insertable(t).IgnoreColumns(IgnoreNullColumn).ExecuteCommand() > 0;
}
public bool InsertIgnoreNullColumn(T t)
{
return _db.Insertable(t).IgnoreColumns(true).ExecuteCommand() > 0;
}
public bool InsertIgnoreNullColumn(T t, params string[] columns)
{
return _db.Insertable(t).IgnoreColumns(columns).ExecuteCommand() > 0;
}
public bool Insert(SqlSugarClient client, T t)
@ -42,6 +53,16 @@ namespace Repository
return _db.Insertable(t).ExecuteCommand() > 0;
}
public bool InsertIgnoreNullColumn(List<T> t)
{
return _db.Insertable(t).IgnoreColumns(true).ExecuteCommand() > 0;
}
public bool InsertIgnoreNullColumn(List<T> t, params string[] columns)
{
return _db.Insertable(t).IgnoreColumns(columns).ExecuteCommand() > 0;
}
public DbResult<bool> InsertTran(T t)
{
var result = _db.Ado.UseTran(() =>
@ -132,7 +153,7 @@ namespace Repository
};
}
//_db.Updateable(entity).IgnoreColumns(c => list.Contains(c)).Where(isNull).ExecuteCommand()
return _db.Updateable(entity).IgnoreColumns(isNull).IgnoreColumns(c => list.Contains(c)).ExecuteCommand() > 0;
return _db.Updateable(entity).IgnoreColumns(isNull).IgnoreColumns(list.ToArray()).ExecuteCommand() > 0;
}
public bool Update(List<T> entity)
@ -206,6 +227,11 @@ namespace Repository
return _db.Queryable<T>().Where(expression).ToList();
}
public Task<List<T>> QueryableToListAsync(Expression<Func<T, bool>> expression)
{
return _db.Queryable<T>().Where(expression).ToListAsync();
}
public string QueryableToJson(string select, Expression<Func<T, bool>> expressionWhere)
{
var query = _db.Queryable<T>().Select(select).Where(expressionWhere).ToList();

@ -8,6 +8,7 @@ using System.Linq.Expressions;
using YL.Utils.Table;
using YL.Utils.Extensions;
using System.Data;
using System.Threading.Tasks;
namespace Services
{
@ -23,9 +24,19 @@ namespace Services
#region add
public bool Insert(T t)
public bool Insert(T t, bool IgnoreNullColumn = true)
{
return _baseRepository.Insert(t);
return _baseRepository.Insert(t, IgnoreNullColumn);
}
public bool InsertIgnoreNullColumn(T t)
{
return _baseRepository.InsertIgnoreNullColumn(t);
}
public bool InsertIgnoreNullColumn(T t, params string[] columns)
{
return _baseRepository.InsertIgnoreNullColumn(t, columns);
}
public bool Insert(SqlSugarClient client, T t)
@ -38,6 +49,16 @@ namespace Services
return _baseRepository.Insert(t);
}
public bool InsertIgnoreNullColumn(List<T> t)
{
return _baseRepository.InsertIgnoreNullColumn(t);
}
public bool InsertIgnoreNullColumn(List<T> t, params string[] columns)
{
return _baseRepository.InsertIgnoreNullColumn(t, columns);
}
public long InsertBigIdentity(T t)
{
return _baseRepository.InsertBigIdentity(t);
@ -65,17 +86,17 @@ namespace Services
public bool ExecuteCommand(string sql, object parameters)
{
throw new NotImplementedException();
return _baseRepository.ExecuteCommand(sql, parameters);
}
public bool ExecuteCommand(string sql, params SugarParameter[] parameters)
{
throw new NotImplementedException();
return _baseRepository.ExecuteCommand(sql, parameters);
}
public bool ExecuteCommand(string sql, List<SugarParameter> parameters)
{
throw new NotImplementedException();
return _baseRepository.ExecuteCommand(sql, parameters);
}
#endregion add
@ -196,6 +217,11 @@ namespace Services
return _baseRepository.QueryableToList(expression);
}
public Task<List<T>> QueryableToListAsync(Expression<Func<T, bool>> expression)
{
return _baseRepository.QueryableToListAsync(expression);
}
public List<T> QueryableToList(string tableName)
{
return _baseRepository.QueryableToList(tableName);

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using YL.Core.Entity;
using YL.Core.Entity.Fluent.Validation;
using YL.NetCore.DI;
using YL.Utils.Env;
using YL.Utils.Extensions;
using YL.Utils.Json;
using YL.Utils.Log;
@ -125,7 +125,7 @@ namespace Services
}
else
{
var _nlog = ServiceResolve.Resolve<ILogUtil>();
var _nlog = GlobalCore.GetRequiredService<ILogUtil>();
_nlog.Debug(flag.ErrorMessage);
return (false, PubConst.Import3);
}

@ -9,23 +9,23 @@ namespace YL.Utils.Check
where TArgument : class
{
if (argument == null)
throw new ArgumentNullException(nameof(argumentName));
throw new ArgumentNullException(argumentName);
}
public static void ArgumentIsNullException(string argument, string argumentName = "不能为空")
{
if (argument.IsNull2())
throw new ArgumentException(nameof(argumentName));
throw new ArgumentException(argumentName);
}
public static void ArgumentIsNullException(string argumentName = "不能为空")
{
throw new ArgumentException(nameof(argumentName));
throw new ArgumentException(argumentName);
}
public static void ThrowException(string argumentName = "未实现")
{
throw new Exception(nameof(argumentName));
throw new Exception(argumentName);
}
}
}

@ -3,7 +3,11 @@ using Microsoft.Extensions.Configuration.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;
using System;
using System.IO;
using System.Runtime.CompilerServices;
using YL.Utils.Delegate;
using YL.Utils.Log;
namespace YL.Utils.Configs
{
@ -17,7 +21,9 @@ namespace YL.Utils.Configs
{
if (_config != null) return _config;
var configBuilder =
new ConfigurationBuilder().Add(new JsonConfigurationSource()
new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
.Add(new JsonConfigurationSource()
{
Path = "appsettings.json",
ReloadOnChange = true,

@ -38,7 +38,7 @@ namespace YL.Utils.Env
}
}
public static IHostingEnvironment GetHostingEnvironment => GetRequiredService<IHostingEnvironment>();
//public static IWebHostEnvironment GetHostingEnvironment => GetRequiredService<IWebHostEnvironment>();
public static HttpContext Current => GetRequiredService<IHttpContextAccessor>().HttpContext;
@ -46,13 +46,13 @@ namespace YL.Utils.Env
public static IMemoryCache Cache => GetRequiredService<IMemoryCache>();
public static string WebRootPath => GetHostingEnvironment?.WebRootPath;
//public static string WebRootPath => GetHostingEnvironment?.WebRootPath;
public static string ContentRootPath => GetHostingEnvironment?.ContentRootPath;
//public static string ContentRootPath => GetHostingEnvironment?.ContentRootPath;
public static string EnvironmentName => GetHostingEnvironment?.EnvironmentName;
//public static string EnvironmentName => GetHostingEnvironment?.EnvironmentName;
public static string ApplicationName => GetHostingEnvironment?.ApplicationName;
//public static string ApplicationName => GetHostingEnvironment?.ApplicationName;
public static string GetIp()
{

@ -230,7 +230,7 @@ namespace YL.Utils.Excel
return buffer;
}
public static byte[] Export<T>(List<T> list, ExcelVersion version = ExcelVersion.V2007)
public static byte[] Export<T>(List<T> list, ExcelVersion version = ExcelVersion.V2007, string[] ignoreExport = null)
{
if (list.IsNullLt())
{
@ -281,6 +281,10 @@ namespace YL.Utils.Excel
PropertyInfo[] entityProperties = entityType.GetProperties();
for (int j = 0; j < entityProperties.Length; j++)
{
if (ignoreExport != null && ignoreExport.Contains(entityProperties[j].Name))
{
continue;
}
ICell cell = row.CreateCell(j);
cell.CellStyle = cellStyle;
cell.SetCellValue(entityProperties[j].Name);
@ -301,6 +305,10 @@ namespace YL.Utils.Excel
var properties = maxList[k].GetType().GetProperties();
for (int m = 0; m < properties.Length; m++)
{
if (ignoreExport != null && ignoreExport.Contains(properties[m].Name))
{
continue;
}
ICell cell = row1.CreateCell(m);
cell.CellStyle = cellStyle;
var id = properties[m].GetValue(maxList[k])?.ToString();

@ -76,6 +76,7 @@ namespace YL.Utils.Files
if (!sr.EndOfStream)
{
line = sr.ReadToEnd();
sr.Close();
return line;
}
//while ((line = sr.ReadLine()) != null)

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
//using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.WebUtilities;
using Newtonsoft.Json;
@ -85,7 +86,8 @@ namespace YL.Utils.Http
public static (string, string, string) ReadResultExecutingContext(this ResultExecutingContext context)
{
var req = context.HttpContext.Request;
req.EnableRewind();
//req.EnableRewind();
req.EnableBuffering();
var method = req.Method;
var url = $"{req.Scheme}://{req.Host}{req.PathBase}{req.Path}{req.QueryString}";
var urlParam = req.QueryString.ToUriComponent();
@ -116,7 +118,8 @@ namespace YL.Utils.Http
public static string ReadFromResultExecutingContext(this ResultExecutingContext context)
{
var req = context.HttpContext.Request;
req.EnableRewind();
//req.EnableRewind();
req.EnableBuffering();
var method = req.Method;
var url = $"{req.Scheme}://{req.Host}{req.PathBase}{req.Path}{req.QueryString}";
var urlParam = req.QueryString.ToUriComponent();
@ -157,7 +160,8 @@ namespace YL.Utils.Http
public static string ReadFromResultExecutedContext(this ResultExecutedContext context)
{
var req = context.HttpContext.Request;
req.EnableRewind();
//req.EnableRewind();
req.EnableBuffering();
using (var ms = new MemoryStream())
{
req.Body.Position = 0;

@ -1,4 +1,5 @@
using Swifter.Json;
using Swifter.RW;
using System;
using System.Collections.Generic;
using System.Text;

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -6,33 +6,35 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.1.0" />
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.3.0" />
<PackageReference Include="Ben.Demystifier" Version="0.1.4" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.1" />
<PackageReference Include="HtmlSanitizer" Version="4.0.210" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.2" />
<PackageReference Include="HtmlSanitizer" Version="5.0.266-beta" />
<PackageReference Include="IdGen" Version="2.0.3" />
<PackageReference Include="Jil" Version="2.17.0" />
<PackageReference Include="MessagePack" Version="1.7.3.7" />
<PackageReference Include="MessagePack" Version="1.8.80" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
<PackageReference Include="NLog" Version="4.6.3" />
<PackageReference Include="NLog.Config" Version="4.6.3" />
<PackageReference Include="Swifter.Json" Version="1.2.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.14" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NLog" Version="4.6.8" />
<PackageReference Include="NLog.Config" Version="4.6.8" />
<PackageReference Include="Swifter.Json" Version="1.2.9.6" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.6.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.19" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Utf8Json" Version="1.3.7" />
</ItemGroup>

@ -12,7 +12,6 @@ using YL.Core.Orm.SqlSugar;
using Services;
using YL.Utils.Configs;
using YL.Utils.Table;
using Microsoft.AspNetCore.Builder.Internal;
using YL.Utils.Json;
using MediatR;
@ -33,7 +32,7 @@ namespace XUnitTestKopSoftWms
{
o.JsonType = JsonType.Jil;
});
services.AddDIProperty();
//services.AddDIProperty();
services.AddOptions();
services.AddXsrf();
services.AddXss();

@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
@ -21,8 +19,8 @@
<ItemGroup>
<PackageReference Include="AutoFixture.Xunit2" Version="4.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>

@ -0,0 +1,17 @@
@echo off
for /r . %%a in (bin) do (
if exist %%a (
echo "delete" %%a
rd /s /q "%%a"
)
)
for /r . %%a in (obj) do (
if exist %%a (
echo "delete" %%a
rd /s /q "%%a"
)
)
pause
Loading…
Cancel
Save