宁波既有建筑外墙脱落问卷调查
@@ -1,33 +0,0 @@
|
||||
using Furion.ConfigurableOptions;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存配置
|
||||
/// </summary>
|
||||
public class CacheOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存类型
|
||||
/// </summary>
|
||||
public CacheType CacheType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Redis配置
|
||||
/// </summary>
|
||||
public string RedisConnectionString { get; set; }
|
||||
}
|
||||
|
||||
public enum CacheType
|
||||
{
|
||||
/// <summary>
|
||||
/// 内存缓存
|
||||
/// </summary>
|
||||
MemoryCache,
|
||||
|
||||
/// <summary>
|
||||
/// Redis缓存
|
||||
/// </summary>
|
||||
RedisCache
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
@@ -103,5 +104,10 @@ namespace Ewide.Core
|
||||
/// <param name="expire">有效期</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> SetAsync(string key, object value, TimeSpan expire);
|
||||
/// <summary>
|
||||
/// 获取所有缓存
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<string> GetAllKeys();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Ewide.Core
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
private List<string> GetAllKeys()
|
||||
public List<string> GetAllKeys()
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||
var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache);
|
||||
@@ -121,5 +121,6 @@ namespace Ewide.Core
|
||||
//}
|
||||
//return keys;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -62,6 +63,11 @@ namespace Ewide.Core
|
||||
return RedisHelper.Get<T>(key);
|
||||
}
|
||||
|
||||
public List<string> GetAllKeys()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<string> GetAsync(string key)
|
||||
{
|
||||
return RedisHelper.GetAsync(key);
|
||||
|
||||
63
20220330_Vote/Ewide.Core/Cache/SqlSugarCache.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using Furion;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core.Cache
|
||||
{
|
||||
|
||||
public class SqlSugarCache : ICacheService
|
||||
{
|
||||
private static ICache _cache = App.GetOptions<CacheOptions>().CacheType == CacheType.MemoryCache ? App.RootServices.GetService(typeof(MemoryCache)) as ICache : App.RootServices.GetService(typeof(RedisCache)) as ICache;
|
||||
|
||||
public void Add<TV>(string key, TV value)
|
||||
{
|
||||
_cache.Set(key, value);
|
||||
}
|
||||
|
||||
public void Add<TV>(string key, TV value, int cacheDurationInSeconds)
|
||||
{
|
||||
_cache.Set(key, value, TimeSpan.FromSeconds(cacheDurationInSeconds));
|
||||
}
|
||||
|
||||
public bool ContainsKey<TV>(string key)
|
||||
{
|
||||
return _cache.Exists(key);
|
||||
}
|
||||
|
||||
public TV Get<TV>(string key)
|
||||
{
|
||||
return _cache.Get<TV>(key);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllKey<TV>()
|
||||
{
|
||||
|
||||
return _cache.GetAllKeys();
|
||||
}
|
||||
|
||||
public TV GetOrCreate<TV>(string cacheKey, Func<TV> create, int cacheDurationInSeconds = int.MaxValue)
|
||||
{
|
||||
if (this.ContainsKey<TV>(cacheKey))
|
||||
{
|
||||
return this.Get<TV>(cacheKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = create();
|
||||
this.Add(cacheKey, result, cacheDurationInSeconds);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove<TV>(string key)
|
||||
{
|
||||
_cache.Del(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
235
20220330_Vote/Ewide.Core/ConfigOption/ConfigOptions.cs
Normal file
@@ -0,0 +1,235 @@
|
||||
using Furion.ConfigurableOptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 缓存配置
|
||||
/// </summary>
|
||||
public class CacheOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 缓存类型
|
||||
/// </summary>
|
||||
public CacheType CacheType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Redis配置
|
||||
/// </summary>
|
||||
public string RedisConnectionString { get; set; }
|
||||
}
|
||||
public enum CacheType
|
||||
{
|
||||
/// <summary>
|
||||
/// 内存缓存
|
||||
/// </summary>
|
||||
MemoryCache,
|
||||
|
||||
/// <summary>
|
||||
/// Redis缓存
|
||||
/// </summary>
|
||||
RedisCache
|
||||
}
|
||||
/// <summary>
|
||||
/// 系统配置
|
||||
/// </summary>
|
||||
public class SystemSettingsOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 超管是否可以查看所有租户的数据
|
||||
/// </summary>
|
||||
public bool SuperAdminViewAllData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启全局请求日志
|
||||
/// </summary>
|
||||
public bool IsGlobalRequestLog { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 雪花Id配置
|
||||
/// </summary>
|
||||
public class SnowIdOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 取值范围0~63,默认1
|
||||
/// </summary>
|
||||
public string WorkerId { get; set; } = "1";
|
||||
}
|
||||
/// <summary>
|
||||
/// 第三方配置
|
||||
/// </summary>
|
||||
public class OAuthOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
///微信
|
||||
/// </summary>
|
||||
public ThirdParty Wechat { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
public class UploadFileOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 阿里云
|
||||
/// </summary>
|
||||
public FileDescription Aliyun { get; set; }
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
public FileDescription Avatar { get; set; }
|
||||
/// <summary>
|
||||
/// 文档
|
||||
/// </summary>
|
||||
public FileDescription Document { get; set; }
|
||||
/// <summary>
|
||||
/// 商店
|
||||
/// </summary>
|
||||
public FileDescription Shop { get; set; }
|
||||
/// <summary>
|
||||
/// 编辑器
|
||||
/// </summary>
|
||||
public FileDescription Editor { get; set; }
|
||||
/// <summary>
|
||||
/// 默认
|
||||
/// </summary>
|
||||
public FileDescription Default { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据库配置
|
||||
/// </summary>
|
||||
public class ConnectionStringsOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认数据库编号
|
||||
/// </summary>
|
||||
public string DefaultDbNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 默认数据库类型
|
||||
/// </summary>
|
||||
public string DefaultDbType { get; set; }
|
||||
/// <summary>
|
||||
/// 默认数据库连接字符串
|
||||
/// </summary>
|
||||
|
||||
public string DefaultDbString { get; set; }
|
||||
/// <summary>
|
||||
/// 业务库集合
|
||||
/// </summary>
|
||||
public List<DbConfig> DbConfigs { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// JWT配置
|
||||
/// </summary>
|
||||
public class JWTSettingsOptions : IConfigurableOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否验证密钥
|
||||
/// </summary>
|
||||
public bool ValidateIssuerSigningKey { get; set; }
|
||||
/// <summary>
|
||||
/// 密钥
|
||||
/// </summary>
|
||||
public string IssuerSigningKey { get; set; }
|
||||
/// <summary>
|
||||
/// 是否验证签发方
|
||||
/// </summary>
|
||||
public bool ValidateIssuer { get; set; }
|
||||
/// <summary>
|
||||
/// 签发方
|
||||
/// </summary>
|
||||
public string ValidIssuer { get; set; }
|
||||
/// <summary>
|
||||
/// 是否验证签收方
|
||||
/// </summary>
|
||||
public bool ValidateAudience { get; set; }
|
||||
/// <summary>
|
||||
/// 签收方
|
||||
/// </summary>
|
||||
public string ValidAudience { get; set; }
|
||||
/// <summary>
|
||||
/// 是否验证过期时间
|
||||
/// </summary>
|
||||
public bool ValidateLifetime { get; set; }
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public long ExpiredTime { get; set; }
|
||||
/// <summary>
|
||||
/// 过期时间容错值
|
||||
/// </summary>
|
||||
public long ClockSkew { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据库参数
|
||||
/// </summary>
|
||||
public class DbConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库编号
|
||||
/// </summary>
|
||||
public string DbNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库类型
|
||||
/// </summary>
|
||||
public string DbType { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库连接字符串
|
||||
/// </summary>
|
||||
|
||||
public string DbString { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 文件参数
|
||||
/// </summary>
|
||||
public class FileDescription
|
||||
{
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public string path { get; set; }
|
||||
/// <summary>
|
||||
/// 大小
|
||||
/// </summary>
|
||||
public long maxSize { get; set; }
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string[] contentType { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 第三方参数
|
||||
/// </summary>
|
||||
public class ThirdParty
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
public string app_id { get; set; }
|
||||
/// <summary>
|
||||
/// key
|
||||
/// </summary>
|
||||
public string app_key { get; set; }
|
||||
/// <summary>
|
||||
/// 回调地址
|
||||
/// </summary>
|
||||
public string redirect_uri { get; set; }
|
||||
/// <summary>
|
||||
/// scope
|
||||
/// </summary>
|
||||
public string scope { get; set; }
|
||||
|
||||
}
|
||||
public class FileOption
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public int MaxSize { get; set; }
|
||||
public string[] ContentType { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,31 +4,6 @@
|
||||
<name>Ewide.Core</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Ewide.Core.CacheOptions">
|
||||
<summary>
|
||||
缓存配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.CacheOptions.CacheType">
|
||||
<summary>
|
||||
缓存类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.CacheOptions.RedisConnectionString">
|
||||
<summary>
|
||||
Redis配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.CacheType.MemoryCache">
|
||||
<summary>
|
||||
内存缓存
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.CacheType.RedisCache">
|
||||
<summary>
|
||||
Redis缓存
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.ICache">
|
||||
<summary>
|
||||
缓存接口
|
||||
@@ -130,6 +105,12 @@
|
||||
<param name="expire">有效期</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.ICache.GetAllKeys">
|
||||
<summary>
|
||||
获取所有缓存
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.MemoryCache">
|
||||
<summary>
|
||||
内存缓存
|
||||
@@ -253,6 +234,241 @@
|
||||
Token
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.CacheOptions">
|
||||
<summary>
|
||||
缓存配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.CacheOptions.CacheType">
|
||||
<summary>
|
||||
缓存类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.CacheOptions.RedisConnectionString">
|
||||
<summary>
|
||||
Redis配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.CacheType.MemoryCache">
|
||||
<summary>
|
||||
内存缓存
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.CacheType.RedisCache">
|
||||
<summary>
|
||||
Redis缓存
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.SystemSettingsOptions">
|
||||
<summary>
|
||||
系统配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SystemSettingsOptions.SuperAdminViewAllData">
|
||||
<summary>
|
||||
超管是否可以查看所有租户的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SystemSettingsOptions.IsGlobalRequestLog">
|
||||
<summary>
|
||||
是否开启全局请求日志
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.SnowIdOptions">
|
||||
<summary>
|
||||
雪花Id配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SnowIdOptions.WorkerId">
|
||||
<summary>
|
||||
取值范围0~63,默认1
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.OAuthOptions">
|
||||
<summary>
|
||||
第三方配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.OAuthOptions.Wechat">
|
||||
<summary>
|
||||
微信
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.UploadFileOptions">
|
||||
<summary>
|
||||
上传文件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Aliyun">
|
||||
<summary>
|
||||
阿里云
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Avatar">
|
||||
<summary>
|
||||
头像
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Document">
|
||||
<summary>
|
||||
文档
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Shop">
|
||||
<summary>
|
||||
商店
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Editor">
|
||||
<summary>
|
||||
编辑器
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.UploadFileOptions.Default">
|
||||
<summary>
|
||||
默认
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.ConnectionStringsOptions">
|
||||
<summary>
|
||||
数据库配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ConnectionStringsOptions.DefaultDbNumber">
|
||||
<summary>
|
||||
默认数据库编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ConnectionStringsOptions.DefaultDbType">
|
||||
<summary>
|
||||
默认数据库类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ConnectionStringsOptions.DefaultDbString">
|
||||
<summary>
|
||||
默认数据库连接字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ConnectionStringsOptions.DbConfigs">
|
||||
<summary>
|
||||
业务库集合
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.JWTSettingsOptions">
|
||||
<summary>
|
||||
JWT配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidateIssuerSigningKey">
|
||||
<summary>
|
||||
是否验证密钥
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.IssuerSigningKey">
|
||||
<summary>
|
||||
密钥
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidateIssuer">
|
||||
<summary>
|
||||
是否验证签发方
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidIssuer">
|
||||
<summary>
|
||||
签发方
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidateAudience">
|
||||
<summary>
|
||||
是否验证签收方
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidAudience">
|
||||
<summary>
|
||||
签收方
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ValidateLifetime">
|
||||
<summary>
|
||||
是否验证过期时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ExpiredTime">
|
||||
<summary>
|
||||
过期时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.JWTSettingsOptions.ClockSkew">
|
||||
<summary>
|
||||
过期时间容错值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.DbConfig">
|
||||
<summary>
|
||||
数据库参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.DbConfig.DbNumber">
|
||||
<summary>
|
||||
数据库编号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.DbConfig.DbType">
|
||||
<summary>
|
||||
数据库类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.DbConfig.DbString">
|
||||
<summary>
|
||||
数据库连接字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.FileDescription">
|
||||
<summary>
|
||||
文件参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.FileDescription.path">
|
||||
<summary>
|
||||
路径
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.FileDescription.maxSize">
|
||||
<summary>
|
||||
大小
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.FileDescription.contentType">
|
||||
<summary>
|
||||
类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.ThirdParty">
|
||||
<summary>
|
||||
第三方参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ThirdParty.app_id">
|
||||
<summary>
|
||||
id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ThirdParty.app_key">
|
||||
<summary>
|
||||
key
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ThirdParty.redirect_uri">
|
||||
<summary>
|
||||
回调地址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.ThirdParty.scope">
|
||||
<summary>
|
||||
scope
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.ClaimConst.CLAINM_USERID">
|
||||
<summary>
|
||||
用户Id
|
||||
@@ -4695,6 +4911,20 @@
|
||||
<param name="file"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.Service.SysFileService.UploadFilesDefault(System.Collections.Generic.List{Microsoft.AspNetCore.Http.IFormFile})">
|
||||
<summary>
|
||||
上传文件
|
||||
</summary>
|
||||
<param name="files"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.Service.SysFileService.UploadFileDefault(Microsoft.AspNetCore.Http.FormFileCollection)">
|
||||
<summary>
|
||||
批量上传文件
|
||||
</summary>
|
||||
<param name="files"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.Service.SysFileService.DownloadFileInfo(Ewide.Core.Service.QueryFileInoInput)">
|
||||
<summary>
|
||||
下载文件
|
||||
@@ -6810,6 +7040,470 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Ewide.Core.SqlSugarRepository`1">
|
||||
<summary>
|
||||
SqlSugar 仓储实现类
|
||||
</summary>
|
||||
<typeparam name="TEntity"></typeparam>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.SqlSugarRepository`1._db">
|
||||
<summary>
|
||||
初始化 SqlSugar 客户端
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SqlSugarRepository`1.Context">
|
||||
<summary>
|
||||
数据库上下文
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SqlSugarRepository`1.EntityContext">
|
||||
<summary>
|
||||
独立数据库上下文
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.#ctor(SqlSugar.ISqlSugarClient)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
<param name="db"></param>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SqlSugarRepository`1.Entities">
|
||||
<summary>
|
||||
实体集合
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Ewide.Core.SqlSugarRepository`1.Ado">
|
||||
<summary>
|
||||
原生 Ado 对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Count(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取总数
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.CountAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取总数
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Any(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
检查是否存在
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AnyAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
检查是否存在
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Single(System.Object)">
|
||||
<summary>
|
||||
通过主键获取实体
|
||||
</summary>
|
||||
<param name="Id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Single(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取一个实体
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.SingleAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取一个实体
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.FirstOrDefault(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取一个实体
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.FirstOrDefaultAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取一个实体
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToList">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToList(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToList(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}},System.Linq.Expressions.Expression{System.Func{`0,System.Object}},SqlSugar.OrderByType)">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<param name="orderByExpression"></param>
|
||||
<param name="orderByType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToListAsync">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToListAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.ToListAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}},System.Linq.Expressions.Expression{System.Func{`0,System.Object}},SqlSugar.OrderByType)">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<param name="orderByExpression"></param>
|
||||
<param name="orderByType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Insert(`0)">
|
||||
<summary>
|
||||
新增一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Insert(`0[])">
|
||||
<summary>
|
||||
新增多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Insert(System.Collections.Generic.IEnumerable{`0})">
|
||||
<summary>
|
||||
新增多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnIdentity(`0)">
|
||||
<summary>
|
||||
新增一条记录返回自增Id
|
||||
</summary>
|
||||
<param name="insertObj"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnSnowflakeId(`0)">
|
||||
<summary>
|
||||
新增一条记录返回雪花Id
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnEntity(`0)">
|
||||
<summary>
|
||||
新增一条记录返回实体
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertAsync(`0)">
|
||||
<summary>
|
||||
新增一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertAsync(`0[])">
|
||||
<summary>
|
||||
新增多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertAsync(System.Collections.Generic.IEnumerable{`0})">
|
||||
<summary>
|
||||
新增多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnIdentityAsync(`0)">
|
||||
<summary>
|
||||
新增一条记录返回自增Id
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnSnowflakeIdAsync(`0)">
|
||||
<summary>
|
||||
新增一条记录返回雪花Id
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.InsertReturnEntityAsync(`0)">
|
||||
<summary>
|
||||
新增一条记录返回实体
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Update(`0)">
|
||||
<summary>
|
||||
更新一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Update(`0[])">
|
||||
<summary>
|
||||
更新多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Update(System.Collections.Generic.IEnumerable{`0})">
|
||||
<summary>
|
||||
更新多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.UpdateIgnoreNullAsync(`0)">
|
||||
<summary>
|
||||
更新一条记录忽略所有Null值
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.UpdateAsync(`0)">
|
||||
<summary>
|
||||
更新一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Update(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}},System.Linq.Expressions.Expression{System.Func{`0,`0}})">
|
||||
<summary>
|
||||
更新记录
|
||||
</summary>
|
||||
<param name="predicate">更新的条件</param>
|
||||
<param name="content">更新的内容</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.UpdateAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}},System.Linq.Expressions.Expression{System.Func{`0,`0}})">
|
||||
<summary>
|
||||
更新记录
|
||||
</summary>
|
||||
<param name="predicate">更新的条件</param>
|
||||
<param name="content">更新的内容</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.UpdateAsync(`0[])">
|
||||
<summary>
|
||||
更新多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.UpdateAsync(System.Collections.Generic.IEnumerable{`0})">
|
||||
<summary>
|
||||
更新多条记录
|
||||
</summary>
|
||||
<param name="entities"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Delete(`0)">
|
||||
<summary>
|
||||
删除一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Delete(System.Object)">
|
||||
<summary>
|
||||
删除一条记录
|
||||
</summary>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Delete(System.Object[])">
|
||||
<summary>
|
||||
删除多条记录
|
||||
</summary>
|
||||
<param name="keys"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Delete(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
自定义条件删除记录
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.DeleteAsync(`0)">
|
||||
<summary>
|
||||
删除一条记录
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.DeleteAsync(System.Object)">
|
||||
<summary>
|
||||
删除一条记录
|
||||
</summary>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.DeleteAsync(System.Object[])">
|
||||
<summary>
|
||||
删除多条记录
|
||||
</summary>
|
||||
<param name="keys"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.DeleteAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
自定义条件删除记录
|
||||
</summary>
|
||||
<param name="whereExpression"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Where(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
根据表达式查询多条记录
|
||||
</summary>
|
||||
<param name="predicate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Where(System.Boolean,System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
根据表达式查询多条记录
|
||||
</summary>
|
||||
<param name="condition"></param>
|
||||
<param name="predicate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsQueryable">
|
||||
<summary>
|
||||
构建查询分析器
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsQueryable(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
构建查询分析器
|
||||
</summary>
|
||||
<param name="predicate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsEnumerable">
|
||||
<summary>
|
||||
直接返回数据库结果
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsEnumerable(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
直接返回数据库结果
|
||||
</summary>
|
||||
<param name="predicate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsAsyncEnumerable">
|
||||
<summary>
|
||||
直接返回数据库结果
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.AsAsyncEnumerable(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||
<summary>
|
||||
直接返回数据库结果
|
||||
</summary>
|
||||
<param name="predicate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.Change``1">
|
||||
<summary>
|
||||
切换仓储(注意使用环境)
|
||||
</summary>
|
||||
<typeparam name="T">实体类型</typeparam>
|
||||
<returns>仓储</returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.CurrentBeginTran">
|
||||
<summary>
|
||||
当前db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.CurrentCommitTran">
|
||||
<summary>
|
||||
当前db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.CurrentRollbackTran">
|
||||
<summary>
|
||||
当前db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.BeginTran">
|
||||
<summary>
|
||||
所有db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.CommitTran">
|
||||
<summary>
|
||||
所有db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlSugarRepository`1.RollbackTran">
|
||||
<summary>
|
||||
所有db
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlsugarSetup.IsSuperAdmin">
|
||||
<summary>
|
||||
判断是不是超级管理员
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlsugarSetup.AddSqlSugar(Microsoft.Extensions.DependencyInjection.IServiceCollection,SqlSugar.ConnectionConfig,System.Action{SqlSugar.ISqlSugarClient})">
|
||||
<summary>
|
||||
添加 SqlSugar 拓展
|
||||
</summary>
|
||||
<param name="services"></param>
|
||||
<param name="config"></param>
|
||||
<param name="buildAction"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Ewide.Core.SqlsugarSetup.AddSqlSugar(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Collections.Generic.List{SqlSugar.ConnectionConfig},System.Action{SqlSugar.ISqlSugarClient})">
|
||||
<summary>
|
||||
添加 SqlSugar 拓展
|
||||
</summary>
|
||||
<param name="services"></param>
|
||||
<param name="configs"></param>
|
||||
<param name="buildAction"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="F:Ewide.Core.Util.CodeHelper.code_Countdown">
|
||||
<summary>
|
||||
发送验证码间隔时间(秒)
|
||||
|
||||
678
20220330_Vote/Ewide.Core/SqlSugar/SqlSugarRepository.cs
Normal file
@@ -0,0 +1,678 @@
|
||||
using Furion;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// SqlSugar 仓储实现类
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
public partial class SqlSugarRepository<TEntity>
|
||||
where TEntity : class, new()
|
||||
{
|
||||
private readonly string[] UpdateIgnoreColumns = new string[] { "CreatedTime", "CreatedUserId", "CreatedUserName" };
|
||||
|
||||
#region 属性
|
||||
/// <summary>
|
||||
/// 初始化 SqlSugar 客户端
|
||||
/// </summary>
|
||||
private readonly SqlSugarScope _db;
|
||||
|
||||
/// <summary>
|
||||
/// 数据库上下文
|
||||
/// </summary>
|
||||
public virtual SqlSugarScope Context { get; }
|
||||
/// <summary>
|
||||
/// 独立数据库上下文
|
||||
/// </summary>
|
||||
public virtual SqlSugarProvider EntityContext { get; }
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="db"></param>
|
||||
public SqlSugarRepository(ISqlSugarClient db)
|
||||
{
|
||||
Context = _db = (SqlSugarScope)db;
|
||||
EntityContext = _db.GetConnectionWithAttr<TEntity>();
|
||||
Ado = EntityContext.Ado;
|
||||
}
|
||||
/// <summary>
|
||||
/// 实体集合
|
||||
/// </summary>
|
||||
public virtual ISugarQueryable<TEntity> Entities => EntityContext.Queryable<TEntity>();
|
||||
|
||||
/// <summary>
|
||||
/// 原生 Ado 对象
|
||||
/// </summary>
|
||||
public virtual IAdo Ado { get; }
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 获取总数
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public int Count(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Count(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取总数
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public Task<int> CountAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.CountAsync(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查是否存在
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public bool Any(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Any(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查是否存在
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AnyAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Entities.AnyAsync(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过主键获取实体
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public TEntity Single(dynamic Id)
|
||||
{
|
||||
return Entities.InSingle(Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个实体
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public TEntity Single(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Single(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个实体
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public Task<TEntity> SingleAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.SingleAsync(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个实体
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public TEntity FirstOrDefault(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.First(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个实体
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<TEntity> FirstOrDefaultAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Entities.FirstAsync(whereExpression);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<TEntity> ToList()
|
||||
{
|
||||
return Entities.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public List<TEntity> ToList(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Where(whereExpression).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <returns></returns>
|
||||
public List<TEntity> ToList(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc)
|
||||
{
|
||||
return Entities.OrderByIF(orderByExpression != null, orderByExpression, orderByType).Where(whereExpression).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<List<TEntity>> ToListAsync()
|
||||
{
|
||||
return Entities.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public Task<List<TEntity>> ToListAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Where(whereExpression).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <returns></returns>
|
||||
public Task<List<TEntity>> ToListAsync(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc)
|
||||
{
|
||||
return Entities.OrderByIF(orderByExpression != null, orderByExpression, orderByType).Where(whereExpression).ToListAsync();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 新增
|
||||
public virtual IInsertable<TEntity> AsInsertable(TEntity entity)
|
||||
{
|
||||
return EntityContext.Insertable(entity);
|
||||
}
|
||||
|
||||
public virtual IInsertable<TEntity> AsInsertable(params TEntity[] entities)
|
||||
{
|
||||
return EntityContext.Insertable(entities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Insert(TEntity entity)
|
||||
{
|
||||
return EntityContext.Insertable(entity).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Insert(params TEntity[] entities)
|
||||
{
|
||||
return EntityContext.Insertable(entities).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Insert(IEnumerable<TEntity> entities)
|
||||
{
|
||||
return EntityContext.Insertable(entities.ToArray()).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回自增Id
|
||||
/// </summary>
|
||||
/// <param name="insertObj"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int InsertReturnIdentity(TEntity insertObj)
|
||||
{
|
||||
return EntityContext.Insertable(insertObj).ExecuteReturnIdentity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回雪花Id
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual long InsertReturnSnowflakeId(TEntity entity)
|
||||
{
|
||||
return EntityContext.Insertable(entity).ExecuteReturnSnowflakeId();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回实体
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual TEntity InsertReturnEntity(TEntity entity)
|
||||
{
|
||||
return EntityContext.Insertable(entity).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> InsertAsync(TEntity entity)
|
||||
{
|
||||
return EntityContext.Insertable(entity).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> InsertAsync(params TEntity[] entities)
|
||||
{
|
||||
return EntityContext.Insertable(entities).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> InsertAsync(IEnumerable<TEntity> entities)
|
||||
{
|
||||
if (entities != null && entities.Any())
|
||||
{
|
||||
return EntityContext.Insertable(entities.ToArray()).ExecuteCommandAsync();
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回自增Id
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<long> InsertReturnIdentityAsync(TEntity entity)
|
||||
{
|
||||
return await EntityContext.Insertable(entity).ExecuteReturnBigIdentityAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回雪花Id
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<long> InsertReturnSnowflakeIdAsync(TEntity entity)
|
||||
{
|
||||
return await EntityContext.Insertable(entity).ExecuteReturnSnowflakeIdAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增一条记录返回实体
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<TEntity> InsertReturnEntityAsync(TEntity entity)
|
||||
{
|
||||
return await EntityContext.Insertable(entity).ExecuteReturnEntityAsync();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新
|
||||
|
||||
/// <summary>
|
||||
/// 更新一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(TEntity entity)
|
||||
{
|
||||
return EntityContext.Updateable(entity).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(params TEntity[] entities)
|
||||
{
|
||||
return EntityContext.Updateable(entities).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommand();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(IEnumerable<TEntity> entities)
|
||||
{
|
||||
return EntityContext.Updateable(entities.ToArray()).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommand();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新一条记录忽略所有Null值
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<int> UpdateIgnoreNullAsync(TEntity entity)
|
||||
{
|
||||
return await EntityContext.Updateable(entity).IgnoreColumns(true).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommandAsync();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<int> UpdateAsync(TEntity entity)
|
||||
{
|
||||
return await EntityContext.Updateable(entity).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommandAsync();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新记录
|
||||
/// </summary>
|
||||
/// <param name="predicate">更新的条件</param>
|
||||
/// <param name="content">更新的内容</param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TEntity>> content)
|
||||
{
|
||||
return EntityContext.Updateable(content).Where(predicate).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新记录
|
||||
/// </summary>
|
||||
/// <param name="predicate">更新的条件</param>
|
||||
/// <param name="content">更新的内容</param>
|
||||
/// <returns></returns>
|
||||
public virtual async Task<int> UpdateAsync(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, TEntity>> content)
|
||||
{
|
||||
return await EntityContext.Updateable(content).Where(predicate).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> UpdateAsync(params TEntity[] entities)
|
||||
{
|
||||
return EntityContext.Updateable(entities).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新多条记录
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> UpdateAsync(IEnumerable<TEntity> entities)
|
||||
{
|
||||
return EntityContext.Updateable(entities.ToArray()).IgnoreColumns(UpdateIgnoreColumns).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public virtual IUpdateable<TEntity> AsUpdateable(TEntity entity)
|
||||
{
|
||||
return EntityContext.Updateable(entity).IgnoreColumns(UpdateIgnoreColumns);
|
||||
}
|
||||
|
||||
public virtual IUpdateable<TEntity> AsUpdateable(IEnumerable<TEntity> entities)
|
||||
{
|
||||
return EntityContext.Updateable<TEntity>(entities).IgnoreColumns(UpdateIgnoreColumns);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Delete(TEntity entity)
|
||||
{
|
||||
return EntityContext.Deleteable(entity).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一条记录
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Delete(object key)
|
||||
{
|
||||
return EntityContext.Deleteable<TEntity>().In(key).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除多条记录
|
||||
/// </summary>
|
||||
/// <param name="keys"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Delete(params object[] keys)
|
||||
{
|
||||
return EntityContext.Deleteable<TEntity>().In(keys).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义条件删除记录
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public int Delete(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return EntityContext.Deleteable<TEntity>().Where(whereExpression).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一条记录
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> DeleteAsync(TEntity entity)
|
||||
{
|
||||
return EntityContext.Deleteable(entity).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一条记录
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> DeleteAsync(object key)
|
||||
{
|
||||
return EntityContext.Deleteable<TEntity>().In(key).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除多条记录
|
||||
/// </summary>
|
||||
/// <param name="keys"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<int> DeleteAsync(params object[] keys)
|
||||
{
|
||||
return EntityContext.Deleteable<TEntity>().In(keys).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义条件删除记录
|
||||
/// </summary>
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<int> DeleteAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return await EntityContext.Deleteable<TEntity>().Where(whereExpression).ExecuteCommandAsync();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 其他
|
||||
/// <summary>
|
||||
/// 根据表达式查询多条记录
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual ISugarQueryable<TEntity> Where(Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
return AsQueryable(predicate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据表达式查询多条记录
|
||||
/// </summary>
|
||||
/// <param name="condition"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual ISugarQueryable<TEntity> Where(bool condition, Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
return AsQueryable().WhereIF(condition, predicate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建查询分析器
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual ISugarQueryable<TEntity> AsQueryable()
|
||||
{
|
||||
return Entities;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建查询分析器
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual ISugarQueryable<TEntity> AsQueryable(Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
return Entities.Where(predicate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 直接返回数据库结果
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual List<TEntity> AsEnumerable()
|
||||
{
|
||||
return AsQueryable().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 直接返回数据库结果
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual List<TEntity> AsEnumerable(Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
return AsQueryable(predicate).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 直接返回数据库结果
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual Task<List<TEntity>> AsAsyncEnumerable()
|
||||
{
|
||||
return AsQueryable().ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 直接返回数据库结果
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual Task<List<TEntity>> AsAsyncEnumerable(Expression<Func<TEntity, bool>> predicate)
|
||||
{
|
||||
return AsQueryable(predicate).ToListAsync();
|
||||
}
|
||||
|
||||
public virtual bool IsExists(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.Any(whereExpression);
|
||||
}
|
||||
|
||||
public virtual Task<bool> IsExistsAsync(Expression<Func<TEntity, bool>> whereExpression)
|
||||
{
|
||||
return Entities.AnyAsync(whereExpression);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 仓储事务
|
||||
/// <summary>
|
||||
/// 切换仓储(注意使用环境)
|
||||
/// </summary>
|
||||
/// <typeparam name="T">实体类型</typeparam>
|
||||
/// <returns>仓储</returns>
|
||||
public virtual SqlSugarRepository<T> Change<T>()
|
||||
where T : class, new()
|
||||
{
|
||||
return App.GetService<SqlSugarRepository<T>>();
|
||||
}
|
||||
/// <summary>
|
||||
/// 当前db
|
||||
/// </summary>
|
||||
public void CurrentBeginTran()
|
||||
{
|
||||
Ado.BeginTran();
|
||||
}
|
||||
/// <summary>
|
||||
/// 当前db
|
||||
/// </summary>
|
||||
public void CurrentCommitTran()
|
||||
{
|
||||
Ado.CommitTran();
|
||||
}
|
||||
/// <summary>
|
||||
/// 当前db
|
||||
/// </summary>
|
||||
public void CurrentRollbackTran()
|
||||
{
|
||||
Ado.RollbackTran();
|
||||
}
|
||||
/// <summary>
|
||||
/// 所有db
|
||||
/// </summary>
|
||||
public void BeginTran()
|
||||
{
|
||||
Context.BeginTran();
|
||||
}
|
||||
/// <summary>
|
||||
/// 所有db
|
||||
/// </summary>
|
||||
public void CommitTran()
|
||||
{
|
||||
Context.CommitTran();
|
||||
}
|
||||
/// <summary>
|
||||
/// 所有db
|
||||
/// </summary>
|
||||
public void RollbackTran()
|
||||
{
|
||||
Context.RollbackTran();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
283
20220330_Vote/Ewide.Core/SqlSugar/SqlsugarSetup.cs
Normal file
@@ -0,0 +1,283 @@
|
||||
using Ewide.Core;
|
||||
using Ewide.Core.Cache;
|
||||
using Furion;
|
||||
using Furion.Logging.Extensions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Core
|
||||
{
|
||||
public static class SqlsugarSetup
|
||||
{
|
||||
public static void AddSqlsugarSetup(this IServiceCollection services)
|
||||
{
|
||||
var connList = App.GetConfig<List<MutiDBConnectionString>>("ConnectionStrings")?.Where(p => p.Enabled).ToList();
|
||||
|
||||
List<ConnectionConfig> connectConfigList = new();
|
||||
connList.ForEach(conn =>
|
||||
{
|
||||
connectConfigList.Add(new ConnectionConfig
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnectionString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsAutoRemoveDataCache = true//自动清理缓存
|
||||
|
||||
},
|
||||
ConfigureExternalServices = new ConfigureExternalServices()
|
||||
{
|
||||
DataInfoCacheService = new SqlSugarCache(),
|
||||
EntityNameService = (type, entity) =>
|
||||
{
|
||||
var attributes = type.GetCustomAttributes(true);
|
||||
if (attributes.Any(it => it is TableAttribute))
|
||||
{
|
||||
entity.DbTableName = (attributes.First(it => it is TableAttribute) as TableAttribute).Name;
|
||||
}
|
||||
},
|
||||
EntityService = (type, column) =>
|
||||
{
|
||||
var attributes = type.GetCustomAttributes(true);
|
||||
if (attributes.Any(it => it is KeyAttribute))// by attribute set primarykey
|
||||
{
|
||||
column.IsPrimarykey = true; //有哪些特性可以看 1.2 特性明细
|
||||
}
|
||||
if (attributes.Any(it => it is ColumnAttribute))
|
||||
{
|
||||
column.DbColumnName = (attributes.First(it => it is ColumnAttribute) as ColumnAttribute).Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
services.AddSqlSugar(connectConfigList.ToArray(), db =>
|
||||
{
|
||||
//处理日志事务
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Debugger.Log(1, "", $"===================CurrentConfigId:{db.CurrentConnectionConfig.ConfigId} SqlSugar log started ===================\r\n");
|
||||
Debugger.Log(2, "语句:", sql);
|
||||
Debugger.Log(3, "参数:", string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
|
||||
Debugger.Log(4, "", $"===================CurrentConfigId:{db.CurrentConnectionConfig.ConfigId} SqlSugar log end ===================\r\n");
|
||||
//App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
List<Type> types = App.EffectiveTypes.Where(a => !a.IsAbstract && a.IsClass && a.GetCustomAttributes(typeof(SugarTable), true)?.FirstOrDefault() != null).ToList();
|
||||
|
||||
SqlSugarScope sqlSugarScope = new SqlSugarScope(connectConfigList,
|
||||
//全局上下文生效
|
||||
db =>
|
||||
{
|
||||
/*
|
||||
* 默认只会配置到第一个数据库,这里按照官方文档进行多数据库/多租户文档的说明进行循环配置
|
||||
*/
|
||||
foreach (var c in connectConfigList)
|
||||
{
|
||||
var dbProvider = db.GetConnectionScope((string)c.ConfigId);
|
||||
//执行超时时间
|
||||
dbProvider.Ado.CommandTimeOut = 30;
|
||||
|
||||
dbProvider.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
if (sql.StartsWith("SELECT"))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
}
|
||||
if (sql.StartsWith("UPDATE") || sql.StartsWith("INSERT"))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
}
|
||||
if (sql.StartsWith("DELETE"))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
}
|
||||
//Console.WriteLine("Sql:" + "\r\n\r\n" + UtilMethods.GetSqlString(c.DbType, sql, pars));
|
||||
App.PrintToMiniProfiler("SqlSugar", "Info", UtilMethods.GetSqlString(c.DbType, sql, pars));
|
||||
$"DB:{c.ConfigId}, Sql:\r\n\r\n {UtilMethods.GetSqlString(c.DbType, sql, pars)}".LogInformation();
|
||||
|
||||
|
||||
};
|
||||
|
||||
dbProvider.Aop.DataExecuting = (oldValue, entityInfo) =>
|
||||
{
|
||||
//// 新增操作
|
||||
//if (entityInfo.OperationType == DataFilterType.InsertByObject)
|
||||
//{
|
||||
// // 主键(long)-赋值雪花Id
|
||||
// if (entityInfo.EntityColumnInfo.IsPrimarykey && entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
|
||||
// {
|
||||
// var id = ((dynamic)entityInfo.EntityValue).Id;
|
||||
// if (id == null || id == 0)
|
||||
// entityInfo.SetValue(Yitter.IdGenerator.YitIdHelper.NextId());
|
||||
// }
|
||||
|
||||
|
||||
// if (entityInfo.PropertyName == "CreatedTime")
|
||||
// entityInfo.SetValue(DateTime.Now);
|
||||
// if (App.User != null)
|
||||
// {
|
||||
// if (entityInfo.PropertyName == "TenantId")
|
||||
// {
|
||||
// var tenantId = ((dynamic)entityInfo.EntityValue).TenantId;
|
||||
// if (tenantId == null || tenantId == 0)
|
||||
// entityInfo.SetValue(App.User.FindFirst(ClaimConst.TENANT_ID)?.Value);
|
||||
// }
|
||||
// if (entityInfo.PropertyName == "CreatedUserId")
|
||||
// {
|
||||
// var createUserId = ((dynamic)entityInfo.EntityValue).CreatedUserId;
|
||||
// if (createUserId == null || createUserId == 0)
|
||||
// entityInfo.SetValue(App.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value);
|
||||
// }
|
||||
|
||||
// if (entityInfo.PropertyName == "CreatedUserName")
|
||||
// entityInfo.SetValue(App.User.FindFirst(ClaimConst.CLAINM_NAME)?.Value);
|
||||
// }
|
||||
//}
|
||||
//// 更新操作
|
||||
//if (entityInfo.OperationType == DataFilterType.UpdateByObject)
|
||||
//{
|
||||
// if (entityInfo.PropertyName == "UpdatedTime")
|
||||
// entityInfo.SetValue(DateTime.Now);
|
||||
// if (entityInfo.PropertyName == "UpdatedUserId")
|
||||
// entityInfo.SetValue(App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value);
|
||||
// if (entityInfo.PropertyName == "UpdatedUserName")
|
||||
// entityInfo.SetValue(App.User?.FindFirst(ClaimConst.CLAINM_NAME)?.Value);
|
||||
|
||||
//}
|
||||
};
|
||||
|
||||
/*
|
||||
* 使用 SqlSugarScope 循环配置此项的时候会覆盖整个 ConfigureExternalServices,
|
||||
* 移动到 New ConnectionConfig中配置
|
||||
*/
|
||||
//db.CurrentConnectionConfig.ConfigureExternalServices = new ConfigureExternalServices()
|
||||
//{
|
||||
// DataInfoCacheService = new SqlSugarCache()//配置我们创建的缓存类
|
||||
//};
|
||||
|
||||
////全局过滤器
|
||||
//var superAdminViewAllData = Convert.ToBoolean(App.GetOptions<SystemSettingsOptions>().SuperAdminViewAllData);
|
||||
//foreach (var entityType in types)
|
||||
//{
|
||||
// // 配置多租户全局过滤器
|
||||
// //if (!entityType.GetProperty(ClaimConst.TENANT_ID).IsEmpty())
|
||||
// //{ //判断实体类中包含TenantId属性
|
||||
// // //构建动态Lambda
|
||||
// // var lambda = DynamicExpressionParser.ParseLambda
|
||||
// // (new[] { Expression.Parameter(entityType, "it") },
|
||||
// // typeof(bool), $"{nameof(DBEntityTenant.TenantId)} == @0 or (@1 and @2)",
|
||||
// // GetTenantId(), IsSuperAdmin(), superAdminViewAllData);
|
||||
// // dbProvider.QueryFilter.Add(new TableFilterItem<object>(entityType, lambda)); //将Lambda传入过滤器
|
||||
// //}
|
||||
// // 配置加删除全局过滤器
|
||||
// if (!entityType.GetProperty(CommonConst.DELETE_FIELD).IsEmpty())
|
||||
// { //判断实体类中包含IsDeleted属性
|
||||
// //构建动态Lambda
|
||||
// var lambda = DynamicExpressionParser.ParseLambda
|
||||
// (new[] { Expression.Parameter(entityType, "it") },
|
||||
// typeof(bool), $"{nameof(DEntityBase.IsDeleted)} == @0",
|
||||
// false);
|
||||
// dbProvider.QueryFilter.Add(new TableFilterItem<object>(entityType, lambda)
|
||||
// {
|
||||
// IsJoinQuery = true
|
||||
// }); //将Lambda传入过滤器
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
});
|
||||
services.AddSingleton<ISqlSugarClient>(sqlSugarScope);
|
||||
// 注册 SqlSugar 仓储
|
||||
services.AddScoped(typeof(SqlSugarRepository<>));
|
||||
|
||||
////如果多个数数据库传 List<ConnectionConfig>
|
||||
//var configConnection = new ConnectionConfig()
|
||||
//{
|
||||
// DbType = SqlSugar.DbType.MySql,
|
||||
// ConnectionString = configuration.GetConnectionString(dbName),
|
||||
// IsAutoCloseConnection = true,
|
||||
//};
|
||||
|
||||
//SqlSugarScope sqlSugar = new SqlSugarScope(configConnection,
|
||||
// db =>
|
||||
// {
|
||||
// //单例参数配置,所有上下文生效
|
||||
// db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
// {
|
||||
// //Console.WriteLine(sql);//输出sql
|
||||
// };
|
||||
// });
|
||||
|
||||
//services.AddSingleton<ISqlSugarClient>(sqlSugar);//这边是SqlSugarScope用AddSingleton
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断是不是超级管理员
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static bool IsSuperAdmin()
|
||||
{
|
||||
if (App.User == null) return false;
|
||||
return App.User.FindFirst(ClaimConst.CLAINM_SUPERADMIN)?.Value == AdminType.SuperAdmin.GetHashCode().ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加 SqlSugar 拓展
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="config"></param>
|
||||
/// <param name="buildAction"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddSqlSugar(this IServiceCollection services, ConnectionConfig config, Action<ISqlSugarClient> buildAction = default)
|
||||
{
|
||||
var list = new List<ConnectionConfig>();
|
||||
list.Add(config);
|
||||
return services.AddSqlSugar(list, buildAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加 SqlSugar 拓展
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <param name="configs"></param>
|
||||
/// <param name="buildAction"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddSqlSugar(this IServiceCollection services, List<ConnectionConfig> configs, Action<ISqlSugarClient> buildAction = default)
|
||||
{
|
||||
// 注册 SqlSugar 客户端
|
||||
services.AddScoped<ISqlSugarClient>(u =>
|
||||
{
|
||||
var db = new SqlSugarClient(configs);
|
||||
buildAction?.Invoke(db);
|
||||
return db;
|
||||
});
|
||||
|
||||
// 注册 SqlSugar 仓储
|
||||
services.AddScoped(typeof(SqlSugarRepository<>));
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
public class MutiDBConnectionString
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ConnectionString { get; set; }
|
||||
public DbType DbType { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using Ewide.Core;
|
||||
using Ewide.Core.Service;
|
||||
using Ewide.Core.Util;
|
||||
using Ewide.EntityFramework.Core.SqlSugar;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.FriendlyException;
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
using Furion;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.EntityFramework.Core.SqlSugar
|
||||
{
|
||||
public static class SqlsugarSetup
|
||||
{
|
||||
public static void AddSqlsugarSetup(this IServiceCollection services)
|
||||
{
|
||||
var connList = App.GetConfig<List<MutiDBConnectionString>>("ConnectionStrings")?.Where(p => p.Enabled).ToList();
|
||||
|
||||
List<ConnectionConfig> connectConfigList = new();
|
||||
connList.ForEach(conn =>
|
||||
{
|
||||
connectConfigList.Add(new ConnectionConfig
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnectionString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = InitKeyType.Attribute
|
||||
});
|
||||
});
|
||||
services.AddSqlSugar(connectConfigList.ToArray(), db =>
|
||||
{
|
||||
//处理日志事务
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Debugger.Log(1, "", $"===================CurrentConfigId:{db.CurrentConnectionConfig.ConfigId} SqlSugar log started ===================\r\n");
|
||||
Debugger.Log(2, "语句:", sql);
|
||||
Debugger.Log(3, "参数:", string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
|
||||
Debugger.Log(4, "", $"===================CurrentConfigId:{db.CurrentConnectionConfig.ConfigId} SqlSugar log end ===================\r\n");
|
||||
//App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
////如果多个数数据库传 List<ConnectionConfig>
|
||||
//var configConnection = new ConnectionConfig()
|
||||
//{
|
||||
// DbType = SqlSugar.DbType.MySql,
|
||||
// ConnectionString = configuration.GetConnectionString(dbName),
|
||||
// IsAutoCloseConnection = true,
|
||||
//};
|
||||
|
||||
//SqlSugarScope sqlSugar = new SqlSugarScope(configConnection,
|
||||
// db =>
|
||||
// {
|
||||
// //单例参数配置,所有上下文生效
|
||||
// db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
// {
|
||||
// //Console.WriteLine(sql);//输出sql
|
||||
// };
|
||||
// });
|
||||
|
||||
//services.AddSingleton<ISqlSugarClient>(sqlSugar);//这边是SqlSugarScope用AddSingleton
|
||||
}
|
||||
}
|
||||
|
||||
public class MutiDBConnectionString
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ConnectionString { get; set; }
|
||||
public DbType DbType { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using Dapper;
|
||||
using Ewide.EntityFramework.Core.SqlSugar;
|
||||
using Ewide.Core;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
Dm = 5,
|
||||
Kdbndp = 6
|
||||
*/
|
||||
{
|
||||
"Id": 1, // 连接id,可以配置到数据库
|
||||
"DBType": 2, // db类型,枚举,具体的看上边
|
||||
"Enabled": false, // 是否开启当前数据库db
|
||||
"Connection": "WMBlog.db" // 连接字符串
|
||||
},
|
||||
{
|
||||
//目前使用的数据库 Ewide.
|
||||
"Id": "118_3310_ewide",
|
||||
"DBType": 0,
|
||||
"Enabled": true,
|
||||
"ConnectionString": ";"
|
||||
"ConnectionString": "Data Source=118.178.224.202;Port=3310;Database=yongjiangbei_vote;User ID=root;Password=root.Ewide;pooling=true;sslmode=none;CharSet=utf8;"
|
||||
},
|
||||
{
|
||||
"Id": 1, // 连接id,可以配置到数据库
|
||||
"DBType": 2, // db类型,枚举,具体的看上边
|
||||
"Enabled": false, // 是否开启当前数据库db
|
||||
"Connection": "WMBlog.db" // 连接字符串
|
||||
},
|
||||
{
|
||||
//不知道干什么用的
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Ewide.Core.Util;
|
||||
using Ewide.EntityFramework.Core;
|
||||
using Ewide.EntityFramework.Core.SqlSugar;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Ewide.Core;
|
||||
using Ewide.EntityFramework.Core;
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
@@ -42,6 +41,7 @@ namespace Ewide.Web.Core
|
||||
services.AddRemoteRequest();
|
||||
|
||||
services.AddConfigurableOptions<CacheOptions>();
|
||||
services.AddConfigurableOptions<UploadFileOptions>();
|
||||
|
||||
services.AddControllersWithViews()
|
||||
.AddMvcFilter<RequestActionFilter>()
|
||||
@@ -70,6 +70,7 @@ namespace Ewide.Web.Core
|
||||
//var workerId = ushort.Parse(App.Configuration["SnowId:WorkerId"] ?? "1");
|
||||
//IDGenerator.SetIdGenerator(new IDGeneratorOptions { WorkerId = workerId });
|
||||
services.AddOSSService("HuaweiCloud", "OSSProvider");
|
||||
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Ewide.Web.Entry.Controllers
|
||||
}
|
||||
public IActionResult Login()
|
||||
{
|
||||
ViewBag.Title = "宁波市“甬江建设杯”选票";
|
||||
//ViewBag.Title = "宁波市“甬江建设杯”选票";
|
||||
return View();
|
||||
}
|
||||
public IActionResult Expert()
|
||||
|
||||
@@ -3,12 +3,16 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Ewide.Web.Entry.Controllers
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class OutsideWallController : Controller
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
public IActionResult Result()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
<script src="http://lib.baomitu.com/qs/6.10.3/qs.min.js"></script>
|
||||
<script src="http://lib.baomitu.com/jsencrypt/3.2.1/jsencrypt.min.js"></script>
|
||||
<script src="https://lib.baomitu.com/jsencrypt/3.2.1/jsencrypt.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -102,7 +102,8 @@
|
||||
else {
|
||||
window.sessionStorage.setItem('__TOKEN', response.data.data.token);
|
||||
//location = '/gb/yjb/manage/VoteResult'
|
||||
location = '/gb/yjb/manage/nbczResult'
|
||||
//location = '/gb/yjb/manage/nbczResult'
|
||||
location = '/gb/yjb/outsidewall/result'
|
||||
}
|
||||
}
|
||||
_this.loading = false;
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
<div id="app" v-loading="loading">
|
||||
<h3 style="text-align:center;">宁波既有建筑外墙脱落问卷调查</h3>
|
||||
<el-form label-position="left" ref="form" :model="form" :rules="rules" label-width="160px" style="margin-top:15px;">
|
||||
<el-form-item label="1.社区/小区名:" prop="communityName">
|
||||
<el-input v-model="form.communityName"></el-input>
|
||||
<el-form-item label="1.社区/小区名:" prop="communityId">
|
||||
<el-select v-model="form.communityId" filterable placeholder="请选择" @@change="selectCommunity">
|
||||
<el-option v-for="item in communitys" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="2.小区交付年份:" prop="deliveryear">
|
||||
<el-input v-model="form.deliveryear"></el-input>
|
||||
@@ -39,8 +42,8 @@
|
||||
<el-input v-model="form.hangye"></el-input>
|
||||
</el-form-item>*@
|
||||
<el-form-item label="3.外墙结构:" prop="outsidewallstructurefiles">
|
||||
|
||||
<el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="fileList" :on-change="fileChange">
|
||||
@*:on-change="fileChange"*@
|
||||
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="handlePreview" :on-remove="(file, fileList)=>{return handleRemove(file, fileList)}" :file-list="fileList" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList)}">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text"><em>上传外墙照片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
@@ -58,62 +61,62 @@
|
||||
</el-upload>*@
|
||||
</el-form-item>
|
||||
<el-form-item label="4.楼栋数:" prop="buildcount">
|
||||
<el-input v-model="form.buildcount"></el-input>
|
||||
<el-input-number v-model="form.buildcount"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="5.住户总数:" prop="householdcount">
|
||||
<el-input v-model="form.householdcount"></el-input>
|
||||
<el-input-number v-model="form.householdcount"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="6.总建筑面积:" prop="totalfloorage">
|
||||
<el-input v-model="form.totalfloorage"></el-input>
|
||||
<el-input-number v-model="form.totalfloorage" :precision="2" :step="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="7.是否存在外墙问题:" prop="isExistProblem">
|
||||
<el-radio-group v-model="form.isExistProblem" size="small">
|
||||
<el-radio-button label="是" border></el-radio-button>
|
||||
<el-radio-button label="否" border></el-radio-button>
|
||||
<el-radio-button label="1" border>是</el-radio-button>
|
||||
<el-radio-button label="0" border>否</el-radio-button>
|
||||
</el-radio-group>
|
||||
<span>例如:漏水、开裂、脱落</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="8.楼栋信息:" prop="buildcount">
|
||||
<el-table :data="form.houses" style="width: 100%" ref="table" tooltip-effect="dark" @@selection-change="handleSelectionChange" row-key="id"
|
||||
<el-form-item label="8.楼栋信息:">
|
||||
<el-table :data="form.buildings" style="width: 100%" ref="table" tooltip-effect="dark" @@selection-change="handleSelectionChange" row-key="id"
|
||||
:expand-row-keys="expands" @@row-click="clickRowHandle">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
@* <el-table-column type="selection" width="55">
|
||||
</el-table-column>*@
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-form label-position="left" class="demo-table-expand" :rules="rules" ref="childForm" :model="props.row">
|
||||
<el-form-item label="幢名称:">
|
||||
<span>{{ props.row.BuildingName }}</span>
|
||||
<span>{{ props.row.buildingName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址:">
|
||||
<span>{{ props.row.Address }}</span>
|
||||
<span>{{ props.row.address }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="层数:">
|
||||
<span>{{ props.row.LevelCount }}</span>
|
||||
<span>{{ props.row.levelCount }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="总户数:">
|
||||
<span>{{ props.row.Households }}</span>
|
||||
<span>{{ props.row.houseHolds }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="建设单位:">
|
||||
<span>{{ props.row.BuildingUnit }}</span>
|
||||
<span>{{ props.row.buildingUnit }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="设计单位:">
|
||||
<span>{{ props.row.DesingerUnit }}</span>
|
||||
<span>{{ props.row.desingerUnit }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="施工单位:">
|
||||
<span>{{ props.row.ConstructionUnit }}</span>
|
||||
<span>{{ props.row.constructionUnit }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="监理单位:">
|
||||
<span>{{ props.row.MonitorUnit }}</span>
|
||||
<span>{{ props.row.monitorUnit }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="物业单位:">
|
||||
<span>{{ props.row.WuYeUnit }}</span>
|
||||
<span>{{ props.row.wuYeUnit }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item prop="curwallproblems">
|
||||
8.1 墙体问题的类型是
|
||||
<el-checkbox-group v-model="props.row.curwallproblems">
|
||||
<el-checkbox v-for="w in wallproblems" :label="w" :key="w">{{w}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-input type="textarea" autosize placeholder="请输入其他问题" v-model="props.row.curwallproblems_other">
|
||||
<el-input type="textarea" autosize placeholder="请输入其他问题" v-model="props.row.curwallproblemother">
|
||||
@*<el-select v-model="curwallproblems" multiple filterable allow-create default-first-option placeholder="请选择问题类型">
|
||||
<el-option v-for="item in wallproblems" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
@@ -161,23 +164,23 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
8.7 问题照片:
|
||||
<el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="childFileList1" :on-change="fileChange1">
|
||||
8.7 问题照片:@* :on-change="fileChange1"*@
|
||||
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,1)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist1" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,1,'东')}">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text"><em>上传东面照片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
</el-upload>
|
||||
<el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="childFileList2" :on-change="fileChange2">
|
||||
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,2)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist2" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,2,'西')}">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text"><em>上传西面照片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
</el-upload>
|
||||
<el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="childFileList3" :on-change="fileChange3">
|
||||
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,3)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist3" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,3,'南')}">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text"><em>上传南面照片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
</el-upload>
|
||||
<el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :auto-upload="false" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="childFileList4" :on-change="fileChange4">
|
||||
<el-upload class="upload-demo" drag action="/gb/yjb/api/outsidewall/sysFileInfo/upload" multiple :auto-upload="true" :on-preview="(file)=>{return handlePreview(file,props,4)}" :on-remove="(file, fileList)=>{return handleRemove(file, fileList,props)}" :file-list="childFileList[props.$index].filelist4" :on-success="(response, file, fileList)=>{return fileChange(response, file, fileList, props,4,'北')}">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text"><em>上传北面照片</em></div>
|
||||
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
@@ -208,56 +211,41 @@
|
||||
<el-checkbox label="混凝土块"></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@*<el-form-item>
|
||||
<el-button type="primary" plain @@click.prevent="tempSave(props.row)">暂存</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>*@
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="幢名称" prop="BuildingName">
|
||||
<el-table-column label="幢名称" prop="buildingName">
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" prop="Address">
|
||||
<el-table-column label="地址" prop="address">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
@*
|
||||
<el-form-item label="参加时间:" prop="date">
|
||||
<el-popover placement="top" title="" width="200" trigger="focus" :content="datePersonNumber">
|
||||
<el-radio-group v-model="form.date" @@input="getNumber()" slot="reference" size="small">
|
||||
<el-radio-button label="2023-03-18" border></el-radio-button>
|
||||
<el-radio-button label="2023-03-19" border></el-radio-button>
|
||||
<el-radio-button label="2023-03-25" border></el-radio-button>
|
||||
<el-radio-button label="2023-03-26" border></el-radio-button>
|
||||
<el-radio-button label="2023-04-08" border></el-radio-button>
|
||||
<el-radio-button label="2023-04-09" border></el-radio-button>
|
||||
<el-radio-button label="2023-04-15" border></el-radio-button>
|
||||
<el-radio-button label="2023-04-16" border></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-popover>
|
||||
</el-form-item>*@
|
||||
<el-form-item prop="problemismodify">
|
||||
<el-form-item prop="problemismodify" v-if="form.isExistProblem=='1'">
|
||||
14.问题发生后是否请人修复了?
|
||||
<el-radio-group v-model="problemismodify">
|
||||
<el-radio label="是"></el-radio>
|
||||
<el-radio label="否"></el-radio>
|
||||
<el-radio-group v-model="form.problemismodify">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="problemismodify=='是'">
|
||||
<el-form-item v-if="form.problemismodify=='1'">
|
||||
15.请提供修复单位的名称:
|
||||
<el-input type="textarea" autosize placeholder="请提供修复单位的名称。" v-model="problemmodifyunitname">
|
||||
<el-input type="textarea" autosize placeholder="请提供修复单位的名称。" v-model="form.problemmodifyunitname">
|
||||
</el-form-item>
|
||||
<el-form-item v-if="problemismodify=='是'">
|
||||
<el-form-item v-if="form.problemismodify=='1'">
|
||||
16.修复后的部位是否再次发生问题?
|
||||
<el-radio-group v-model="problemmodifyisagain">
|
||||
<el-radio label="有再发生"></el-radio>
|
||||
<el-radio label="没有"></el-radio>
|
||||
<el-radio-group v-model="form.problemmodifyisagain">
|
||||
<el-radio label="1">有再发生</el-radio>
|
||||
<el-radio label="0">没有</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
20.若您愿意接受我们的现场调查,请惠赐您的联系方式。谢谢!
|
||||
<el-input type="textarea" autosize placeholder="" v-model="contract">
|
||||
<el-input type="textarea" autosize placeholder="" v-model="form.contract">
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码:" prop="phone">
|
||||
@*<el-form-item label="手机号码:" prop="phone">
|
||||
<el-input v-model="form.phone"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码" prop="code" v-if="!isshowmyinfo">
|
||||
@@ -266,9 +254,9 @@
|
||||
<el-button :disabled="disabled" @@click="getCode">{{ valiBtn }}</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>*@
|
||||
<el-form-item v-if="!isshowmyinfo">
|
||||
<el-button type="primary" @@click.prevent="onSubmit('form')">提交报名</el-button>
|
||||
<el-button type="primary" @@click.prevent="onSubmit('form','childForm')"> 提 交 </el-button>
|
||||
<el-button @@click.prevent="showinfo()">我的报名</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -316,91 +304,16 @@
|
||||
return {
|
||||
form: {
|
||||
communityName: '',
|
||||
phone: '',
|
||||
communityId: '',
|
||||
deliveryear: '',
|
||||
buildcount: '',
|
||||
totalfloorage: 0,
|
||||
address: '',
|
||||
date: '',
|
||||
line: '',
|
||||
code: '',
|
||||
token: '',
|
||||
houses: [{
|
||||
id: '12987122',
|
||||
BuildingName: '好滋好味鸡蛋仔',
|
||||
Address: '江浙小吃、小吃零食',
|
||||
LevelCount: '荷兰优质淡奶,奶香浓而不腻',
|
||||
Households: '上海市普陀区真北路',
|
||||
BuildingUnit: '王小虎夫妻店',
|
||||
DesingerUnit: '10333',
|
||||
curwallproblems: [],
|
||||
wallproblemsfirst: '',
|
||||
firstproblemdate: '',
|
||||
problemfrequency: '',
|
||||
problemseason: [],
|
||||
wallproblemtoward: [],
|
||||
curwallproblems_other: '',
|
||||
problemfanwei: '',
|
||||
problemheight: [],
|
||||
diaoluowu: [],
|
||||
}, {
|
||||
id: '12987123',
|
||||
BuildingName: '好滋好味鸡蛋仔',
|
||||
Address: '江浙小吃、小吃零食',
|
||||
LevelCount: '荷兰优质淡奶,奶香浓而不腻',
|
||||
Households: '上海市普陀区真北路',
|
||||
BuildingUnit: '王小虎夫妻店',
|
||||
DesingerUnit: '10333',
|
||||
curwallproblems: [],
|
||||
wallproblemsfirst: '',
|
||||
firstproblemdate: '',
|
||||
problemfrequency: '',
|
||||
problemseason: [],
|
||||
wallproblemtoward: [],
|
||||
curwallproblems_other: '',
|
||||
problemfanwei: '',
|
||||
problemheight: [],
|
||||
diaoluowu: [],
|
||||
}, {
|
||||
id: '12987124',
|
||||
BuildingName: '好滋好味鸡蛋仔',
|
||||
Address: '江浙小吃、小吃零食',
|
||||
LevelCount: '荷兰优质淡奶,奶香浓而不腻',
|
||||
Households: '上海市普陀区真北路',
|
||||
BuildingUnit: '王小虎夫妻店',
|
||||
DesingerUnit: '10333',
|
||||
curwallproblems: [],
|
||||
wallproblemsfirst: '',
|
||||
firstproblemdate: '',
|
||||
problemfrequency: '',
|
||||
problemseason: [],
|
||||
wallproblemtoward: [],
|
||||
curwallproblems_other: '',
|
||||
problemfanwei: '',
|
||||
problemheight: [],
|
||||
diaoluowu: [],
|
||||
}, {
|
||||
id: '12987125',
|
||||
BuildingName: '好滋好味鸡蛋仔',
|
||||
Address: '江浙小吃、小吃零食',
|
||||
LevelCount: '荷兰优质淡奶,奶香浓而不腻',
|
||||
Households: '上海市普陀区真北路',
|
||||
BuildingUnit: '王小虎夫妻店',
|
||||
DesingerUnit: '10333',
|
||||
curwallproblems: [],
|
||||
wallproblemsfirst: '',
|
||||
firstproblemdate: '',
|
||||
problemfrequency: '',
|
||||
problemseason: [],
|
||||
wallproblemtoward: [],
|
||||
curwallproblems_other: '',
|
||||
problemfanwei: '',
|
||||
problemheight: [],
|
||||
diaoluowu: [],
|
||||
}]
|
||||
//,remark: ''
|
||||
fileList: [],
|
||||
}, rules: {
|
||||
communityName: [{ required: true, trigger: 'blur', message: '请选择社区/小区' }],
|
||||
communityId: [{ required: true, trigger: 'blur', message: '请选择社区/小区' }],
|
||||
phone: [{ validator: checkPhone, required: true, trigger: 'blur' }],
|
||||
code: [{ validator: checkCode, required: true, trigger: 'blur' }],
|
||||
deliveryear: [{ required: false, trigger: 'blur', message: '请输入交付年份' }],
|
||||
@@ -408,7 +321,7 @@
|
||||
householdcount: [{ required: false, trigger: 'blur', message: '请输入住户总数' }],
|
||||
date: [{ required: true, trigger: 'blur', message: '请选择参加时间' }],
|
||||
line: [{ required: true, trigger: 'blur', message: '请选择线路' }],
|
||||
totalfloorage: [{ required: true, trigger: 'blur', message: '请输入总建筑面积' }, { validator: checkNumber, message: '总建筑面积必须为数字值' }],
|
||||
totalfloorage: [{ required: true, trigger: 'blur', message: '请输入总建筑面积' }],//, { validator: checkNumber, message: '总建筑面积必须为数字值' }
|
||||
isExistProblem: [{ required: true, trigger: 'blur', message: '请选择是否' }],
|
||||
curwallproblems: [{ required: true, trigger: ['change', 'blur'], message: '请选择墙体问题' }],
|
||||
firstproblemdate: [{ required: true, trigger: ['change', 'blur'], message: '请选择第一次出现墙体问题时间' }],
|
||||
@@ -424,15 +337,10 @@
|
||||
disabled: false,
|
||||
datePersonNumber: '',
|
||||
go_disabled: false,
|
||||
dates: [],
|
||||
pageline: '',
|
||||
lineTxt: '',
|
||||
isshowmyinfo: false,
|
||||
fileList: [{ name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }, { name: 'food2.jpeg', url: 'https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224' }],
|
||||
childFileList1: [{ name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }, { name: 'food2.jpeg', url: 'https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224' }],
|
||||
childFileList2: [{ name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }, { name: 'food2.jpeg', url: 'https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224' }],
|
||||
childFileList3: [{ name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }, { name: 'food2.jpeg', url: 'https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224' }],
|
||||
childFileList4: [{ name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }, { name: 'food2.jpeg', url: 'https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224' }],
|
||||
fileList: [],
|
||||
dialogImageUrl: '',
|
||||
dialogImageUrls: [],
|
||||
dialogVisible: false,
|
||||
@@ -449,6 +357,8 @@
|
||||
},
|
||||
// 要展开的行,数值的元素是row的key值
|
||||
expands: [],
|
||||
communitys: [],
|
||||
childFileList: []
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
@@ -457,12 +367,66 @@
|
||||
this.form.token = localStorage.getItem("_token");
|
||||
if (this.getQueryString("valid") == "1" || this.form.token)
|
||||
this.showinfo();
|
||||
|
||||
//this.get_go_date();
|
||||
//this.getdates();
|
||||
this.get_line();
|
||||
this.GetCommunitys('');
|
||||
},
|
||||
methods: {
|
||||
GetCommunitys(queryString) {
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'get',
|
||||
url: '/gb/yjb/api/outsidewall/Communitys?searchkey=' + queryString,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
_this.communitys = response.data.data
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
getLabel(arrays, id) {
|
||||
let opt = {};
|
||||
opt = arrays.find((item) => {
|
||||
return item.id === id;
|
||||
});
|
||||
console.log(opt.name);
|
||||
return opt.name;
|
||||
},
|
||||
selectCommunity(v) {
|
||||
this.form.communityName = this.getLabel(this.communitys, v);
|
||||
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'get',
|
||||
url: '/gb/yjb/api/outsidewall/Community/' + v,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
_this.form.buildings = response.data.data
|
||||
_this.form.buildcount = _this.form.buildings.length
|
||||
_this.form.householdcount = _this.form.buildings.reduce((a, key) => { return a + key.houseHolds }, 0)
|
||||
_this.form.totalfloorage = _this.form.buildings.reduce((a, key) => { return a + key.areaCount }, 0)
|
||||
_this.childFileList = [];
|
||||
//_this.form.buildings.forEach((a) => { _this.childFileList.push({ towards: [{ toward: '东', filelist: [] }, { toward: '西', filelist: [] }, { toward: '南', filelist: [] }, { toward: '北', filelist: [] }] }) })
|
||||
_this.form.buildings.forEach((a) => {
|
||||
_this.childFileList.push({ filelist1: [], filelist2: [], filelist3: [], filelist4: [] })
|
||||
});
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
handleValidates(formName) {
|
||||
const list = []
|
||||
const validas = []
|
||||
@@ -498,82 +462,177 @@
|
||||
if (this.handleValidate('childForm')) {
|
||||
|
||||
}
|
||||
//this.curwallproblems.push(this.curwallproblems_other);
|
||||
//if(this.curwallproblems_other.length>0)
|
||||
//this.houses.find(a => a.id == row.id).curwallproblems = this.curwallproblems;
|
||||
},
|
||||
clickRowHandle(row, column, event) {
|
||||
debugger
|
||||
if (this.expands.includes(row.id)) {
|
||||
return;
|
||||
//return;
|
||||
this.expands = this.expands.filter(val => val !== row.id);
|
||||
} else {
|
||||
this.expands = [];
|
||||
this.expands.push(row.id);
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
debugger;
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
fileChange(a, b) {
|
||||
debugger
|
||||
this.fileList = b;
|
||||
fileChange(response, file, fileList, scope, flistidx, toward) {
|
||||
debugger;
|
||||
if (response.success == false) {
|
||||
this.$message.error('上传失败,请稍候重试');
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
if (scope) {
|
||||
eval("this.childFileList[scope.$index].filelist" + flistidx + "=fileList")
|
||||
//if (this.childFileList[scope.$index].towards.filter(a => a.toward == toward).length == 0)
|
||||
// this.childFileList[scope.$index].towards.push({ toward: toward, filelist: [] });
|
||||
//this.childFileList[scope.$index].towards.filter(a => a.toward == toward)[0].filelist.push(file)
|
||||
if (file.response)
|
||||
this.form.buildings.forEach(a => {
|
||||
if (a.id == this.expands[0]) {
|
||||
var _pf = {
|
||||
file: file.response.data,
|
||||
toward: toward
|
||||
}
|
||||
a.problemfiles.push(_pf)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.fileList = fileList;
|
||||
if (file.response)
|
||||
this.form.fileList.push(file.response.data);
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
fileChange1(a, b) {
|
||||
debugger
|
||||
this.childFileList1 = b;
|
||||
},
|
||||
fileChange2(a, b) {
|
||||
debugger
|
||||
this.childFileList2 = b;
|
||||
},
|
||||
fileChange3(a, b) {
|
||||
debugger
|
||||
this.childFileList3 = b;
|
||||
},
|
||||
fileChange4(a, b) {
|
||||
debugger
|
||||
this.childFileList4 = b;
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
//handleRemove1(file, fileList) {
|
||||
// let _this = this;
|
||||
// this.removeFile(file, fileList, function () {
|
||||
// _this.childFileList1 = _this.childFileList1.filter((a) => { return a.uid != file.uid })
|
||||
// if (file.response)
|
||||
// _this.form.buildings.forEach(a => {
|
||||
// if (a.id == _this.expands[0]) {
|
||||
// a.problemfiles = a.problemfiles.filter((x) => { return x.file != file.response.data })
|
||||
// }
|
||||
// })
|
||||
// _this.loading = false;
|
||||
// }, function () { });
|
||||
//},
|
||||
//handleRemove2(file, fileList) {
|
||||
// let _this = this;
|
||||
// this.removeFile(file, fileList, function () {
|
||||
// _this.childFileList2 = _this.childFileList2.filter((a) => { return a.uid != file.uid })
|
||||
// if (file.response)
|
||||
// _this.form.buildings.forEach(a => {
|
||||
// if (a.id == _this.expands[0]) {
|
||||
// a.problemfiles = a.problemfiles.filter((x) => { return x.file != file.response.data })
|
||||
// }
|
||||
// })
|
||||
// _this.loading = false;
|
||||
// }, function () { });
|
||||
//},
|
||||
//handleRemove3(file, fileList) {
|
||||
// let _this = this;
|
||||
// this.removeFile(file, fileList, function () {
|
||||
// _this.childFileList3 = _this.childFileList3.filter((a) => { return a.uid != file.uid })
|
||||
// if (file.response)
|
||||
// _this.form.buildings.forEach(a => {
|
||||
// if (a.id == _this.expands[0]) {
|
||||
// a.problemfiles = a.problemfiles.filter((x) => { return x.file != file.response.data })
|
||||
// }
|
||||
// })
|
||||
// _this.loading = false;
|
||||
// }, function () { });
|
||||
//},
|
||||
//handleRemove4(file, fileList) {
|
||||
// let _this = this;
|
||||
// this.removeFile(file, fileList, function () {
|
||||
// _this.childFileList4 = _this.childFileList4.filter((a) => { return a.uid != file.uid })
|
||||
// if (file.response)
|
||||
// _this.form.buildings.forEach(a => {
|
||||
// if (a.id == _this.expands[0]) {
|
||||
// a.problemfiles = a.problemfiles.filter((x) => { return x.file != file.response.data })
|
||||
// }
|
||||
// })
|
||||
// _this.loading = false;
|
||||
// }, function () { });
|
||||
//},
|
||||
//handleRemove(file, fileList, scope) {
|
||||
// let _this = this;
|
||||
// this.removeFile(file, fileList, function () {
|
||||
// _this.fileList = _this.fileList.filter((a) => { return a.uid != file.uid })
|
||||
// if (file.response)
|
||||
// _this.form.fileList = _this.form.fileList.filter((a) => { return a != file.response.data })
|
||||
// _this.loading = false;
|
||||
// }, function () { });
|
||||
//},
|
||||
handleRemove(file, fileList, scope) {
|
||||
let _this = this;
|
||||
_this.loading = true;
|
||||
console.log(file, fileList);
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'get',
|
||||
url: '/gb/yjb/api/outsidewall/sysFileInfo/delete/' + file.response.data,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
if (scope) {
|
||||
this.childFileList[scope.$index].towards = this.childFileList[scope.$index].towards.filter((a) => { return a.uid != file.uid })
|
||||
|
||||
if (file.response)
|
||||
_this.form.buildings.forEach(a => {
|
||||
if (a.id == _this.expands[0]) {
|
||||
a.problemfiles = a.problemfiles.filter((x) => { return x.file != file.response.data })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.fileList = _this.fileList.filter((a) => { return a.uid != file.uid })
|
||||
if (file.response)
|
||||
_this.form.fileList = _this.form.fileList.filter((a) => { return a != file.response.data });
|
||||
}
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
handlePreview(file) {
|
||||
filePreview(file, fileList) {
|
||||
debugger
|
||||
this.loading = true;
|
||||
console.log(file);
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogImageUrls = this.fileList.map(a => a.url);
|
||||
this.dialogImageUrl = window.location.protocol + "//" + window.location.host + "/gb/yjb/api/outsidewall/sysFileInfo/preview/" + file.response.data;
|
||||
this.dialogImageUrls = fileList.map(a => window.location.protocol + "//" + window.location.host + "/gb/yjb/api/outsidewall/sysFileInfo/preview/" + a.response.data);
|
||||
this.$refs.myImg.showViewer = true
|
||||
const m = (e) => { e.preventDefault() };
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.addEventListener("touchmove", m, false); // 禁止页面滑动
|
||||
this.loading = false;
|
||||
},
|
||||
getQueryString(communityName) {
|
||||
var reg = new RegExp("(^|&)" + communityName + "=([^&]*)(&|$)", "i");
|
||||
handlePreview(file, scope, toward) {
|
||||
debugger
|
||||
if (scope) {
|
||||
eval("this.filePreview(file, this.childFileList[scope.$index].filelist" + toward + ")")
|
||||
//this.filePreview(file, this.childFileList[scope.$index].towards.filter(a => a.toward == toward).filelist)
|
||||
}
|
||||
else
|
||||
this.filePreview(file, this.fileList)
|
||||
},
|
||||
handlePreview1(file, scope) {
|
||||
this.filePreview(file, this.childFileList1)
|
||||
},
|
||||
handlePreview2(file, scope) {
|
||||
this.filePreview(file, this.childFileList2)
|
||||
},
|
||||
handlePreview3(file, scope) {
|
||||
this.filePreview(file, this.childFileList3)
|
||||
},
|
||||
handlePreview4(file, scope) {
|
||||
this.filePreview(file, this.childFileList4)
|
||||
},
|
||||
getQueryString(communityId) {
|
||||
var reg = new RegExp("(^|&)" + communityId + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]); return null;
|
||||
},
|
||||
get_line() {
|
||||
let _this = this;
|
||||
var line = this.getQueryString("line") ?? "A"
|
||||
if (line == "A" || line == "a") {
|
||||
_this.lineTxt = '慈溪:“历史之路 文化之路 创新之路 共富之路”的慈溪南部沿山风情共富线。';
|
||||
_this.pageline = _this.form.line = '慈溪';
|
||||
}
|
||||
else if (line == "B" || line == "b") {
|
||||
_this.lineTxt = '奉化:“应梦明山入城,剡水桃源归野”的奉化明山剡水共富线。';
|
||||
_this.pageline = _this.form.line = '奉化';
|
||||
}
|
||||
else if (line == "C" || line == "c") {
|
||||
_this.lineTxt = '象山:“万象山海,逐梦亚运”象山扬帆亚运风情共富线三条体验游览线。';
|
||||
_this.pageline = _this.form.line = '象山';
|
||||
}
|
||||
},
|
||||
get_go_date() {
|
||||
//判断上车日期
|
||||
let _this = this;
|
||||
_this.form.token = localStorage.getItem("_token");
|
||||
|
||||
},
|
||||
getCode() {
|
||||
this.$refs['form'].validateField('phone', (err) => {
|
||||
if (err) {
|
||||
@@ -624,52 +683,52 @@
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
onSubmit(formName) {
|
||||
onSubmit(formName, formNameChild) {
|
||||
console.log('submit!');
|
||||
let _this = this;
|
||||
this.$refs[formName].validate((valid) => { // 为表单绑定验证功能
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
//this.$alert("成功", "提示")
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/ningbozhichun/submit',
|
||||
data: _this.form,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
if (response.data?.data?.success == true) {
|
||||
let token = response.data.data.token;
|
||||
localStorage.setItem("_token", token)
|
||||
_this.$alert(`<div>提交成功</div>`, '成功', {
|
||||
confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
}).then(a => { }).catch(err => { console.log(err) });
|
||||
if (_this.form.isExistProblem == '0') {
|
||||
_this.submit2();
|
||||
} else {
|
||||
_this.$alert(`<div>` + response.data.message + `</div>`, '错误', {
|
||||
confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
}).then(a => { }).catch(err => { console.log(err) });
|
||||
if (this.$refs[formNameChild])
|
||||
this.$refs[formNameChild].validate((valid) => {
|
||||
if (valid) {
|
||||
debugger
|
||||
_this.submit2();
|
||||
}
|
||||
});
|
||||
}
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
go(formName) {
|
||||
console.log('上车!');
|
||||
submit2() {
|
||||
debugger;
|
||||
let _this = this;
|
||||
this.$refs[formName].validate((valid) => { // 为表单绑定验证功能
|
||||
if (valid) {
|
||||
//let config = {
|
||||
// //formData 提交请求头有两种 multipart/form-data 和 application/x-www-form-urlencoded
|
||||
// // multipart/form-data 用于type=file 的input提交
|
||||
// headers: {
|
||||
// "Content-Type": "multipart/form-data"
|
||||
// }
|
||||
//};
|
||||
//const fd = new FormData()
|
||||
//fd.append('appid', "123")
|
||||
//fd.append('wall', _this.form)
|
||||
//for (let _i in _this.fileList) {
|
||||
// fd.append('file', _i)
|
||||
//}
|
||||
//axios.post('/gb/yjb/api/outsidewall/submit', fd, config).then(res => {
|
||||
// debugger
|
||||
//}).catch(error => {
|
||||
// console.log(error);
|
||||
//});
|
||||
|
||||
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/ningbozhichun/submit',
|
||||
url: '/gb/yjb/api/outsidewall/submit',
|
||||
data: _this.form,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
@@ -693,9 +752,20 @@
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
|
||||
},
|
||||
getFormData(object) {
|
||||
const formData = new FormData()
|
||||
Object.keys(object).forEach(key => {
|
||||
const value = object[key]
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((subValue, i) =>
|
||||
formData.append(key + `[${i}]`, subValue)
|
||||
)
|
||||
} else {
|
||||
formData.append(key, object[key])
|
||||
}
|
||||
});
|
||||
})
|
||||
return formData
|
||||
},
|
||||
loading_false() { this.loading = false },
|
||||
showinfo() {
|
||||
@@ -782,11 +852,6 @@
|
||||
display: none;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
/*.el-image__inner
|
||||
{
|
||||
visibility: hidden;
|
||||
display:none;
|
||||
} */
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
|
||||
344
20220330_Vote/Ewide.Web.Entry/Views/OutsideWall/Result.cshtml
Normal file
@@ -0,0 +1,344 @@
|
||||
@*
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
<script src="http://lib.baomitu.com/qs/6.10.3/qs.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app" v-loading="loading">
|
||||
<h3 style="text-align:center;">宁波既有建筑外墙脱落问卷调查 报名结果</h3>
|
||||
<el-form label-position="left" ref="form" :model="form" label-width="120px" style="margin-top:15px;">
|
||||
<el-form-item label="社区/小区:" prop="name">
|
||||
<el-select v-model="form.communityId" filterable placeholder="请选择" @@change="selectCommunity">
|
||||
<el-option v-for="item in communitys" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @@click.prevent="onSubmit('form')">查询</el-button>
|
||||
<el-button @@click.prevent="reset('form')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-descriptions class="margin-top" title="" :column="2" border>
|
||||
<el-descriptions-item :span="2">
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-user"></i>*@
|
||||
报名日期
|
||||
</template>
|
||||
{{ props.row.createdTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-user"></i>*@
|
||||
姓名
|
||||
</template>
|
||||
{{ props.row.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item labelStyle="width:90px;">
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-user"></i>*@
|
||||
手机号码
|
||||
</template>
|
||||
{{ props.row.phone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-mobile-phone"></i>*@
|
||||
微信号码
|
||||
</template>
|
||||
{{ props.row.weixin_number }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-location-outline"></i>*@
|
||||
身份证号码
|
||||
</template>
|
||||
{{ props.row.cardno }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@* <i class="el-icon-tickets"></i>*@
|
||||
行业
|
||||
</template>
|
||||
@* <el-tag size="small">学校</el-tag>*@
|
||||
{{ props.row.hangye }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@*<i class="el-icon-office-building"></i>*@
|
||||
所在地
|
||||
</template>
|
||||
{{ props.row.address }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名日期"><template slot-scope="props">{{ dateFormat("mm-dd", props.row.createdTime )}}</template></el-table-column>
|
||||
<el-table-column label="姓名/手机号码"><template slot-scope="props">{{ props.row.name}}<br />{{ props.row.phone}}</template></el-table-column>
|
||||
<el-table-column label="日期/线路"><template slot-scope="props">{{ props.row.date}} {{ props.row.line}}</template></el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<h3 style="text-align:center;">
|
||||
<el-button @@click="load_projects">刷新数据</el-button>
|
||||
<el-button type="primary" @@click="export_excel" :loading="loading">导出Excel</el-button>
|
||||
</h3>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
phone: '',
|
||||
weixin_number: '',
|
||||
cardno: '',
|
||||
hangye: '',
|
||||
address: '',
|
||||
date: '',
|
||||
line: '',
|
||||
code: '',
|
||||
token: ''
|
||||
//,remark: ''
|
||||
},
|
||||
tableData: [],
|
||||
loading: false,
|
||||
token: '',
|
||||
communitys: [], communityId: ''
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.check_login()
|
||||
this.loading = true;
|
||||
this.GetCommunitys('');
|
||||
|
||||
},
|
||||
methods: {
|
||||
GetCommunitys(queryString) {
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'get',
|
||||
url: '/gb/yjb/api/outsidewall/Communitys?searchkey=' + queryString,
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
_this.communitys = response.data.data
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
selectCommunity(v) {
|
||||
//this.form.communityName = this.getLabel(this.communitys, v);
|
||||
this.communityId = v
|
||||
},
|
||||
onSubmit(formName) {
|
||||
console.log('submit!');
|
||||
let _this = this;
|
||||
this.$refs[formName].validate((valid) => { // 为表单绑定验证功能
|
||||
if (valid) {
|
||||
//this.$alert("成功", "提示")
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'get',
|
||||
url: '/gb/yjb/api/outsidewall/query/' + this.communityId,
|
||||
data: _this.form,
|
||||
responseType: "json",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(async response => {
|
||||
debugger
|
||||
if (response.data.success == true) {
|
||||
_this.tableData = response.data;
|
||||
} else {
|
||||
_this.$alert(`<div>` + response.data.message + `</div>`, '错误', {
|
||||
confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
}).then(a => { }).catch(err => { console.log(err) });
|
||||
}
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}, reset(formName) {
|
||||
this.form = {}
|
||||
},
|
||||
export_excel() {
|
||||
this.loading = true;
|
||||
this.download('/gb/yjb/api/ningbozhichun/export_excel', this.dateFormat("YYYYmmddHHMMSS", new Date()) + "-共赴宁波之春.xlsx", this.loading_false);
|
||||
},
|
||||
check_login() {
|
||||
this.token = window.sessionStorage.getItem('__TOKEN');
|
||||
if (!this.token)
|
||||
location = '/gb/yjb/manage/login'
|
||||
},
|
||||
|
||||
load_projects() {
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/ningbozhichun/GetPersonList',
|
||||
data: {},
|
||||
responseType: "json",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
console.log(response)
|
||||
_this.tableData = response.data.data
|
||||
_this.loading = false;
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
loading_false() { this.loading = false },
|
||||
|
||||
download(url, filename, callback) {
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: url,
|
||||
data: {},
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
console.log(response);
|
||||
//解析文件充blod中解析
|
||||
const url = window.URL.createObjectURL(
|
||||
new Blob([response.data], { type: "application/vnd.ms-excel" })
|
||||
);
|
||||
const link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.href = url;
|
||||
link.setAttribute("download", filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
callback();
|
||||
}).catch(function (error) {
|
||||
callback();
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
})
|
||||
},
|
||||
getMonthWeek(now) {
|
||||
var a = now.getYear();
|
||||
var b = now.getMonth() + 1;
|
||||
var c = now.getDate();
|
||||
/*
|
||||
a = d = 当前日期
|
||||
b = 6 - w = 当前周的还有几天过完(不算今天)
|
||||
a + b 的和在除以7 就是当天是当前月份的第几周
|
||||
*/
|
||||
var date = new Date(a, parseInt(b) - 1, c), w = date.getDay(), d = date.getDate();
|
||||
return Math.ceil(
|
||||
(d + 6 - w) / 7
|
||||
);
|
||||
},
|
||||
dateFormat(fmt, d) {
|
||||
const date = new Date(d);
|
||||
let ret;
|
||||
const opt = {
|
||||
"Y+": date.getFullYear().toString(), // 年
|
||||
"m+": (date.getMonth() + 1).toString(), // 月
|
||||
"d+": date.getDate().toString(), // 日
|
||||
"H+": date.getHours().toString(), // 时
|
||||
"M+": date.getMinutes().toString(), // 分
|
||||
"S+": date.getSeconds().toString() // 秒
|
||||
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||
};
|
||||
for (let k in opt) {
|
||||
ret = new RegExp("(" + k + ")").exec(fmt);
|
||||
if (ret) {
|
||||
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
|
||||
};
|
||||
};
|
||||
return fmt;
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
.buhuanhang {
|
||||
white-space: nowrap;
|
||||
width: 21%;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 98%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.el-card__body p {
|
||||
margin: 0px;
|
||||
margin-bottom: 5px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.el-radio.is-bordered {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-radio-button--small .el-radio-button__inner {
|
||||
border-left: 1px solid #DCDFE6;
|
||||
}
|
||||
</style>
|
||||
|
||||
</html>
|
||||
@@ -50,6 +50,11 @@
|
||||
"SmsAccount": "tempaccount0309",
|
||||
"SmsPwd": "Aabc!@#20KHL+@+124bjaT(6q",
|
||||
"TotalCount": 40
|
||||
},
|
||||
"OutsideWallSetting": {
|
||||
"SanjuKey": "vPFu7zKB08Uaxuzsc5zozAAT6W0zr3qw",
|
||||
"GetCommunitys": "http://sjk.test.ky.com/housesafety/statistics/GetCommunitys?searchName={0}",
|
||||
"GetHouseInfoCitysByCommunity": "http://sjk.test.ky.com/housesafety/statistics/GetHouseInfoCitysByCommunity?communityID={0}"
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 831 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 820 B |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 375 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 820 B |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 340 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 417 B |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 215 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 119 KiB |
@@ -5,241 +5,322 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Ewide.Core;
|
||||
using Ewide.Core.Util;
|
||||
using Ewide.Core.Service;
|
||||
using Furion;
|
||||
using Furion.ClayObject.Extensions;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DataEncryption;
|
||||
using Furion.DataEncryption.Extensions;
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.FriendlyException;
|
||||
using Furion.RemoteRequest.Extensions;
|
||||
using Google.Protobuf.Reflection;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HPSF;
|
||||
using Vote.Services.Dto;
|
||||
using Vote.Services.Entities;
|
||||
|
||||
namespace Vote.Services.ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 共赴宁波之春
|
||||
/// 外墙调查问卷
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings("outsidewall", Order = 0)]
|
||||
[Route("/gb/yjb/api/outsidewall")]
|
||||
public class OutsideWallService : IDynamicApiController
|
||||
{
|
||||
private readonly IRepository<Entities.nbzc_person> repPerson;
|
||||
private readonly IRepository<Entities.nbzc_sms_code> repSmsCode;
|
||||
private readonly SqlSugarRepository<Entities.outside_wall> repoutside_wall;
|
||||
private readonly SqlSugarRepository<Entities.outside_wall_building> repoutside_wall_building;
|
||||
private readonly SqlSugarRepository<Entities.outside_wall_building_photo> repoutside_wall_building_photo;
|
||||
private readonly SqlSugarRepository<Entities.outside_wall_photo> repoutside_wall_photo;
|
||||
private readonly SqlSugarRepository<SysFile> rep_SysFile;
|
||||
private readonly IMemoryCache _memoryCache;
|
||||
readonly IOptions<UploadFileOptions> _options;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="_repNingbo"></param>
|
||||
public OutsideWallService(IRepository<Entities.nbzc_person> _repNingbo, IRepository<Entities.nbzc_sms_code> _repSmsCode, IMemoryCache memoryCache)
|
||||
/// <param name="_repoutside_wall"></param>
|
||||
/// <param name="_repoutside_wall_building"></param>
|
||||
/// <param name="_repoutside_wall_building_photo"></param>
|
||||
/// <param name="_repoutside_wall_photo"></param>
|
||||
/// <param name="memoryCache"></param>
|
||||
public OutsideWallService(SqlSugarRepository<Entities.outside_wall> _repoutside_wall, SqlSugarRepository<Entities.outside_wall_building> _repoutside_wall_building, SqlSugarRepository<Entities.outside_wall_building_photo> _repoutside_wall_building_photo, SqlSugarRepository<Entities.outside_wall_photo> _repoutside_wall_photo, IMemoryCache memoryCache, SqlSugarRepository<SysFile> _rep_SysFile, IOptions<UploadFileOptions> options)
|
||||
{
|
||||
repPerson = _repNingbo;
|
||||
this.repSmsCode = _repSmsCode;
|
||||
repoutside_wall = _repoutside_wall;
|
||||
repoutside_wall_building = _repoutside_wall_building;
|
||||
repoutside_wall_building_photo = _repoutside_wall_building_photo;
|
||||
repoutside_wall_photo = _repoutside_wall_photo;
|
||||
_memoryCache = memoryCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[Route("sendcode")]
|
||||
public async Task<dynamic> SendCode(NbzcSendCodeInput args)
|
||||
{
|
||||
//var data = await repSmsCode.DetachedEntities.Where(p => p.phone == args.phone && !p.IsDeleted && p.expire_time > DateTime.Now)
|
||||
// .FirstOrDefaultAsync();
|
||||
//_ = (data != null) ? throw Oops.Oh("已存在此号码的有效发送记录,不可重复发送") : 1;
|
||||
var lastSend = await repSmsCode.DetachedEntities.Where(p => p.phone == args.phone && !p.IsDeleted).OrderByDescending(a => a.CreatedTime).FirstOrDefaultAsync();
|
||||
_ = lastSend != null && DateTime.Now <= lastSend.CreatedTime.Value.AddMinutes(1) ? throw Oops.Oh("发送过于频繁,请1分钟后再试") : 1;
|
||||
|
||||
//_ = (await repPerson.DetachedEntities.Where(a => !a.IsDeleted && (a.phone == args.phone || a.cardno == args.cardno)).CountAsync() > 0) ? throw Oops.Oh("您已提交,无需再次获取验证码") : 1;
|
||||
string _timeCacheKey = "sms_token_" + args.phone;
|
||||
var code = new Random().Next(1001, 9999);
|
||||
if (App.GetConfig<int>("NingboZhiChun:OpenSms") == 1)
|
||||
{
|
||||
var cacheTokenValue = _memoryCache.Get<string>(_timeCacheKey);
|
||||
if (string.IsNullOrEmpty(cacheTokenValue))
|
||||
{
|
||||
var rslt = await App.GetConfig<string>("NingboZhiChun:SmsTokenUrl").SetBody(new { username = App.GetConfig<string>("NingboZhiChun:SmsAccount"), password = App.GetConfig<string>("NingboZhiChun:SmsPwd") }, "application/json").SetHttpMethod(HttpMethod.Post).SendAsStringAsync();
|
||||
cacheTokenValue = Newtonsoft.Json.Linq.JObject.Parse(rslt)["data"]["token"].ToString();
|
||||
var cacheEntryOptions = new MemoryCacheEntryOptions()
|
||||
.SetSlidingExpiration(TimeSpan.FromMinutes(100));
|
||||
_memoryCache.Set(_timeCacheKey, cacheTokenValue, cacheEntryOptions);
|
||||
}
|
||||
var sendrslt = await App.GetConfig<string>("NingboZhiChun:SmsSendUrl")
|
||||
.SetHttpMethod(HttpMethod.Post)
|
||||
.SetHeaders(new Dictionary<string, object> { { "Authorization", "Bearer " + cacheTokenValue } })
|
||||
.SetBody(new { phone_number = args.phone, sms_content = $"您的验证码是:{code},10分钟内有效。" })
|
||||
.SendAsStringAsync();
|
||||
if (!Newtonsoft.Json.Linq.JObject.Parse(sendrslt)["issuccess"].Value<bool>())
|
||||
throw Oops.Oh("验证码短信发送失败.");
|
||||
}
|
||||
await new Entities.nbzc_sms_code
|
||||
{
|
||||
code = code.ToString(),
|
||||
CreatedTime = DateTime.Now,
|
||||
expire_time = DateTime.Now.AddMinutes(10),
|
||||
IsDeleted = false,
|
||||
phone = args.phone
|
||||
}.InsertOrUpdate();
|
||||
return true;
|
||||
_options = options;
|
||||
rep_SysFile = _rep_SysFile;
|
||||
}
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// 获取三居系统中的社区
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<dynamic> SubmitSubmit(NbzcSubmitInput args)
|
||||
[AllowAnonymous]
|
||||
[HttpGet("query/{id}")]
|
||||
public async Task<dynamic> Query(string id)
|
||||
{
|
||||
var lastSend = await repSmsCode.DetachedEntities.Where(p => p.phone == args.phone && !p.IsDeleted).OrderByDescending(a => a.CreatedTime).FirstOrDefaultAsync();
|
||||
_ = (lastSend == null || lastSend.code != args.code || lastSend.expire_time < DateTime.Now) ? throw Oops.Oh("验证码错误或已失效") : 1;
|
||||
var totalCount = await repPerson.DetachedEntities.Where(a => !a.IsDeleted && a.date == args.date).CountAsync();
|
||||
_ = totalCount >= App.GetConfig<int>("NingboZhiChun:TotalCount") ? throw Oops.Oh("提交失败,名额已满。") : 1;
|
||||
_ = (await repPerson.DetachedEntities.Where(a => !a.IsDeleted && (a.phone == args.phone || a.cardno == args.cardno)).CountAsync() > 0) ? throw Oops.Oh("您已提交,无需再次提交") : 1;
|
||||
var now = DateTime.Now;
|
||||
var model = new Entities.nbzc_person
|
||||
{
|
||||
address = args.address,
|
||||
phone = args.phone,
|
||||
cardno = args.cardno,
|
||||
CreatedTime = DateTime.Now,
|
||||
date = args.date,
|
||||
hangye = args.hangye,
|
||||
IsDeleted = false,
|
||||
line = args.line,
|
||||
name = args.name,
|
||||
weixin_number = args.weixin_number
|
||||
};
|
||||
model = await model.InsertOrUpdate();
|
||||
lastSend.IsDeleted = true;
|
||||
await repSmsCode.UpdateIncludeAsync(lastSend, new string[] { nameof(lastSend.IsDeleted) });
|
||||
var token = JWTEncryption.Encrypt(new Dictionary<string, object>() // 加密
|
||||
{
|
||||
{ "UserId", model.Id },
|
||||
{ "Account",model.phone }
|
||||
});
|
||||
return new { success = true, token };
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取我的报名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[Route("getmyinfo")]
|
||||
public async Task<dynamic> GetMyInfo(NbzcGetMyInfoInput args)
|
||||
{
|
||||
var newToken = args.token;
|
||||
nbzc_person entity = null;
|
||||
if (!string.IsNullOrEmpty(args.token))
|
||||
{
|
||||
var tokenData = JWTEncryption.ReadJwtToken(args.token);
|
||||
//_ = (tokenData == null) ? throw Oops.Oh("您还没有提交过或者手机号码填写错误") : 1;
|
||||
if (tokenData == null)
|
||||
{
|
||||
newToken = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var userId = tokenData.Claims.Where(a => a.Type == "UserId").FirstOrDefault().Value;
|
||||
entity = await repPerson.DetachedEntities.Where(a => a.Id == userId).FirstOrDefaultAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = (string.IsNullOrEmpty(args.code)) ? throw Oops.Oh("验证码错误或已失效") : 1;
|
||||
var lastSend = await repSmsCode.DetachedEntities.Where(p => p.phone == args.phone && !p.IsDeleted).OrderByDescending(a => a.CreatedTime).FirstOrDefaultAsync();
|
||||
_ = (lastSend == null || lastSend.code != args.code || lastSend.expire_time < DateTime.Now) ? throw Oops.Oh("验证码错误或已失效") : 1;
|
||||
entity = await repPerson.DetachedEntities.Where(a => a.phone == args.phone && !a.IsDeleted).FirstOrDefaultAsync();
|
||||
var entity = await repoutside_wall.AsQueryable().FirstAsync(a => a.communityId == id);
|
||||
if (entity != null)
|
||||
newToken = JWTEncryption.Encrypt(new Dictionary<string, object>()
|
||||
{
|
||||
{ "UserId", entity.Id },
|
||||
{ "Account",entity.phone }
|
||||
var outside_wall_photos = await repoutside_wall_photo.AsQueryable().Where(a => a.outsidewallId == entity.Id).ToListAsync();
|
||||
entity.outside_wall_photos = outside_wall_photos;
|
||||
var outside_wall_buildings = await repoutside_wall_building.AsQueryable().Where(a => a.outsidewallId == entity.Id).ToListAsync();
|
||||
entity.outside_wall_buildings = outside_wall_buildings;
|
||||
return entity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取三居系统中的社区
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("communitys")]
|
||||
public async Task<List<SanjuCommunity>> GetCommunitys(string searchkey)
|
||||
{
|
||||
var cacheKey = "cache_GetCommunitys";
|
||||
List<SanjuCommunity> Communitys = null;
|
||||
Communitys = _memoryCache.Get<List<SanjuCommunity>>(cacheKey);
|
||||
if (Communitys == null || Communitys.Count == 0)
|
||||
{
|
||||
//var aaaaaaaaaaaaaa = repoutside_wall.AsQueryable().ToList();
|
||||
var SanjuKey = App.GetConfig<string>("OutsideWallSetting:SanjuKey");
|
||||
var timeStamp = GetTimeStamp();
|
||||
var sign = (SanjuKey + timeStamp).ToMD5Encrypt();
|
||||
var GetCommunitysUrl = App.GetConfig<string>("OutsideWallSetting:GetCommunitys");
|
||||
var GetHouseInfoCitysByCommunityUrl = App.GetConfig<string>("OutsideWallSetting:GetHouseInfoCitysByCommunity");
|
||||
Communitys = await string.Format(GetCommunitysUrl, "")
|
||||
.SetHeaders(new Dictionary<string, object> { { "sign", sign }, { "timeStamp", timeStamp } })
|
||||
.GetAsAsync<List<SanjuCommunity>>();
|
||||
_memoryCache.Set(cacheKey, Communitys, DateTime.Now.AddHours(1));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchkey))
|
||||
return Communitys.Where(a => a.Name.Contains(searchkey)).ToList();
|
||||
return Communitys;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取三居系统中的社区
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("community/{id}")]
|
||||
public async Task<dynamic> GetCommunityInfo(string id)
|
||||
{
|
||||
var cacheKey = "cache_building_" + id;
|
||||
List<SanjuBuilding> building = _memoryCache.Get<List<SanjuBuilding>>(cacheKey);
|
||||
if (building == null)
|
||||
{
|
||||
var SanjuKey = App.GetConfig<string>("OutsideWallSetting:SanjuKey");
|
||||
var timeStamp = GetTimeStamp();
|
||||
var sign = (SanjuKey + timeStamp).ToMD5Encrypt();
|
||||
var GetHouseInfoCitysByCommunityUrl = App.GetConfig<string>("OutsideWallSetting:GetHouseInfoCitysByCommunity");
|
||||
building = await string.Format(GetHouseInfoCitysByCommunityUrl, id)
|
||||
.SetHeaders(new Dictionary<string, object> { { "sign", sign }, { "timeStamp", timeStamp } })
|
||||
.GetAsAsync<List<SanjuBuilding>>();
|
||||
_memoryCache.Set(cacheKey, building, DateTime.Now.AddHours(1));
|
||||
}
|
||||
return building;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间戳
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetTimeStamp()
|
||||
{
|
||||
TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
return Convert.ToInt64(ts.TotalMilliseconds).ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost("sysFileInfo/upload")]
|
||||
public async Task<string> UploadFileDefault(IFormFile file)
|
||||
{
|
||||
return await UploadFile(file, _options.Value.Default);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除文件
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("sysFileInfo/delete/{id}")]
|
||||
public async Task DeleteFile(string id)
|
||||
{
|
||||
var entity = await rep_SysFile.AsQueryable().FirstAsync(a => a.Id == id);
|
||||
_ = entity == null ? throw Oops.Oh("参数异常") : "";
|
||||
var pathType = _options.Value.Default.path;
|
||||
var filePath = Path.Combine(App.WebHostEnvironment.WebRootPath, pathType);
|
||||
File.Delete(Path.Combine(filePath, entity.FileObjectName));
|
||||
await rep_SysFile.DeleteAsync(id);
|
||||
}
|
||||
/// <summary>
|
||||
/// 预览文件
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("sysFileInfo/preview/{id}")]
|
||||
public async Task<IActionResult> PreviewFileInfo(string id)
|
||||
{
|
||||
var file = await rep_SysFile.AsQueryable().FirstAsync(a => a.Id == id);
|
||||
_ = file == null ? throw Oops.Oh("参数异常") : "";
|
||||
var filePath = Path.Combine(App.WebHostEnvironment.WebRootPath, file.FileBucket, file.FileObjectName);
|
||||
var fileName = HttpUtility.UrlEncode(file.FileOriginName?.Replace(" ", null).Replace("\"", null), Encoding.UTF8);
|
||||
return new FileStreamResult(new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Ewide.Core.Util.MimeMapping.GetMimeMapping(filePath)) { FileDownloadName = fileName };
|
||||
//return await DownloadFileInfo(input);
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <param name="pathType"></param>
|
||||
/// <returns></returns>
|
||||
private static async Task<string> UploadFile(IFormFile file, FileDescription fileOption)
|
||||
{
|
||||
var pathType = fileOption.path;
|
||||
var mimeType = Ewide.Core.Util.MimeMapping.GetMimeMapping(file.FileName);
|
||||
if (!fileOption.contentType.Contains(mimeType))
|
||||
{
|
||||
throw Oops.Oh("上传文件mimeType错误!");
|
||||
}
|
||||
var fileId = Guid.NewGuid().ToString();
|
||||
var fileSizeKb = (long)(file.Length / 1024.0); // 文件大小KB
|
||||
if (fileSizeKb > fileOption.maxSize)
|
||||
{
|
||||
throw Oops.Oh("文件大小超过最大限制!");
|
||||
}
|
||||
var originalFilename = file.FileName; // 文件原始名称
|
||||
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
|
||||
var finalName = fileId + fileSuffix; // 生成文件的最终名称
|
||||
var filePath = Path.Combine(App.WebHostEnvironment.WebRootPath, pathType);
|
||||
if (!Directory.Exists(filePath))
|
||||
Directory.CreateDirectory(filePath);
|
||||
|
||||
using (var stream = File.Create(Path.Combine(filePath, finalName)))
|
||||
{
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
var sysFileInfo = new SysFile
|
||||
{
|
||||
Id = fileId,
|
||||
FileLocation = (int)FileLocation.LOCAL,
|
||||
FileBucket = pathType,
|
||||
FileObjectName = finalName,
|
||||
FileOriginName = originalFilename,
|
||||
FileSuffix = fileSuffix.TrimStart('.'),
|
||||
FileSizeKb = fileSizeKb
|
||||
};
|
||||
//await rep_SysFile.InsertAsync(sysFileInfo);
|
||||
await sysFileInfo.InsertAsync();
|
||||
|
||||
return fileId;
|
||||
}
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Consumes("application/json", "multipart/form-data")]
|
||||
[HttpPost("submit")]
|
||||
[AllowAnonymous]
|
||||
public async Task<dynamic> Submit([FromForm] OutsideWallInput args)
|
||||
{
|
||||
try
|
||||
{
|
||||
repoutside_wall.Ado.BeginTran();
|
||||
var wall = args.Adapt<outside_wall>();
|
||||
wall.Id = Guid.NewGuid().ToString();
|
||||
wall.createtime = DateTime.Now;
|
||||
wall.isdeleted = 0;
|
||||
wall = await repoutside_wall.InsertReturnEntityAsync(wall);
|
||||
if (args.fileList != null)
|
||||
{
|
||||
foreach (var item in args.fileList)
|
||||
{
|
||||
await repoutside_wall_photo.InsertReturnEntityAsync(new outside_wall_photo
|
||||
{
|
||||
outsidewallId = wall.Id,
|
||||
sysfileid = item
|
||||
});
|
||||
}
|
||||
return new { success = true, entity, token = newToken };
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取时间线路人数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
[Route("getnumber")]
|
||||
public async Task<dynamic> GetNumber(NbzcGetNumberInput args)
|
||||
foreach (var item in args.buildings)
|
||||
{
|
||||
var n = await repPerson.DetachedEntities.Where(a => !a.IsDeleted && a.date == args.date).CountAsync();
|
||||
return new { success = true, n = App.GetConfig<int>("NingboZhiChun:TotalCount") - n };
|
||||
var build = item.Adapt<outside_wall_building>();
|
||||
build.Id = Guid.NewGuid().ToString();
|
||||
build.outsidewallId = wall.Id;
|
||||
build.BuildingId = build.Id;
|
||||
build.createtime = DateTime.Now;
|
||||
build = await repoutside_wall_building.InsertReturnEntityAsync(build);
|
||||
if (item.problemfiles != null)
|
||||
{
|
||||
foreach (var item1 in item.problemfiles)
|
||||
{
|
||||
await repoutside_wall_building_photo.InsertReturnEntityAsync(new outside_wall_building_photo
|
||||
{
|
||||
outsidewallBuildingId = build.Id,
|
||||
sysfileid = item1.file,
|
||||
toward = item1.Toward
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取清单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Route("GetPersonList")]
|
||||
public async Task<dynamic> GetPersonList(NbzcGetListInput args)
|
||||
}
|
||||
}
|
||||
repoutside_wall.Ado.CommitTran();
|
||||
return "提交成功";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var list = await repPerson.DetachedEntities.Where(a => !a.IsDeleted).OrderByDescending(a => a.CreatedTime).ToListAsync();
|
||||
return list;
|
||||
repoutside_wall.Ado.RollbackTran();
|
||||
throw Oops.Oh(ex.Message + ex.StackTrace);
|
||||
}
|
||||
//var lastSend = await repSmsCode.DetachedEntities.Where(p => p.phone == args.phone && !p.IsDeleted).OrderByDescending(a => a.CreatedTime).FirstOrDefaultAsync();
|
||||
//_ = (lastSend == null || lastSend.code != args.code || lastSend.expire_time < DateTime.Now) ? throw Oops.Oh("验证码错误或已失效") : 1;
|
||||
//var totalCount = await repPerson.DetachedEntities.Where(a => !a.IsDeleted && a.date == args.date).CountAsync();
|
||||
//_ = totalCount >= App.GetConfig<int>("NingboZhiChun:TotalCount") ? throw Oops.Oh("提交失败,名额已满。") : 1;
|
||||
//_ = (await repPerson.DetachedEntities.Where(a => !a.IsDeleted && (a.phone == args.phone || a.cardno == args.cardno)).CountAsync() > 0) ? throw Oops.Oh("您已提交,无需再次提交") : 1;
|
||||
//var now = DateTime.Now;
|
||||
//var model = new Entities.nbzc_person
|
||||
//{
|
||||
// address = args.address,
|
||||
// phone = args.phone,
|
||||
// cardno = args.cardno,
|
||||
// CreatedTime = DateTime.Now,
|
||||
// date = args.date,
|
||||
// hangye = args.hangye,
|
||||
// IsDeleted = false,
|
||||
// line = args.line,
|
||||
// name = args.name,
|
||||
// weixin_number = args.weixin_number
|
||||
//};
|
||||
//model = await model.InsertOrUpdate();
|
||||
//lastSend.IsDeleted = true;
|
||||
//await repSmsCode.UpdateIncludeAsync(lastSend, new string[] { nameof(lastSend.IsDeleted) });
|
||||
//var token = JWTEncryption.Encrypt(new Dictionary<string, object>() // 加密
|
||||
//{
|
||||
// { "UserId", model.Id },
|
||||
// { "Account",model.phone }
|
||||
//});
|
||||
//return new { success = true, token };
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Route("export_excel")]
|
||||
public async Task<dynamic> ExportExcel(NbzcGetListInput args)
|
||||
{
|
||||
var list = await repPerson.DetachedEntities.Where(a => !a.IsDeleted).OrderByDescending(a => a.CreatedTime).ToListAsync();
|
||||
var filepath = Tools.ExcelHelper.WriteExcelNingBoZhiChun(list);
|
||||
return new FileStreamResult(new FileStream(filepath, FileMode.Open), "application/octet-stream") { FileDownloadName = filepath };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[Route("query")]
|
||||
public async Task<dynamic> Query(NbzcQueryInput args)
|
||||
{
|
||||
List<nbzc_person> result = null;
|
||||
var iquery = repPerson.DetachedEntities.Where(a => !a.IsDeleted);
|
||||
if (args == null)
|
||||
result = await iquery.ToListAsync();
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(args.date))
|
||||
iquery = iquery.Where(a => a.date == args.date);
|
||||
if (!string.IsNullOrEmpty(args.name))
|
||||
iquery = iquery.Where(a => a.name.Contains(args.name));
|
||||
if (!string.IsNullOrEmpty(args.phone))
|
||||
iquery = iquery.Where(a => a.phone.Contains(args.phone));
|
||||
if (!string.IsNullOrEmpty(args.line))
|
||||
iquery = iquery.Where(a => a.line == args.line);
|
||||
result = await iquery.ToListAsync();
|
||||
}
|
||||
return new { success = true, result };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
96
20220330_Vote/Vote.Services/Dto/OutsideWallInput.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Vote.Services.Entities;
|
||||
|
||||
namespace Vote.Services.Dto
|
||||
{
|
||||
public class aaaaa
|
||||
{
|
||||
public string appid { get; set; }
|
||||
public OutsideWallInput wall { get; set; }
|
||||
public FormFileCollection file { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class OutsideWallInput
|
||||
{
|
||||
public string communityId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string communityName { get; set; }
|
||||
public string deliveryear { get; set; }
|
||||
public List<string> fileList { get; set; }
|
||||
public decimal buildcount { get; set; }
|
||||
public decimal householdcount { get; set; }
|
||||
public decimal totalfloorage { get; set; }
|
||||
public int isExistProblem { get; set; }
|
||||
public int problemismodify { get; set; }
|
||||
public string problemmodifyunitname { get; set; }
|
||||
public string problemmodifyisagain { get; set; }
|
||||
public string contract { get; set; }
|
||||
public List<SanjuBuilding> buildings { get; set; }
|
||||
}
|
||||
public class SanjuCommunity
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string Code { get; set; }
|
||||
}
|
||||
public class SanjuBuilding
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string AreaName { get; set; }
|
||||
public string RoadName { get; set; }
|
||||
public string CompletedDate { get; set; }
|
||||
public string BuildingName { get; set; }
|
||||
public string Address { get; set; }
|
||||
public int LevelCount { get; set; }
|
||||
public int HouseHolds { get; set; }
|
||||
public string BuildingUnit { get; set; }
|
||||
public string DesingerUnit { get; set; }
|
||||
public string ConstructionUnit { get; set; }
|
||||
public string MonitorUnit { get; set; }
|
||||
public string WuYeUnit { get; set; }
|
||||
public decimal AreaCount { get; set; }
|
||||
public List<string> curwallproblems { get; set; } = new List<string>();
|
||||
public string curwallproblemother { get; set; }
|
||||
public string wallproblemsfirst { get; set; }
|
||||
public string firstproblemdate { get; set; }
|
||||
public string problemfrequency { get; set; }
|
||||
public List<string> problemseason { get; set; } = new List<string>();
|
||||
public List<string> wallproblemtoward { get; set; } = new List<string>();
|
||||
public List<ProblemToward> problemfiles { get; set; } = new List<ProblemToward>();
|
||||
//public List<string> problemfiles2 { get; set; }
|
||||
//public List<string> problemfiles3 { get; set; }
|
||||
//public List<string> problemfiles4 { get; set; }
|
||||
public string problemfanwei { get; set; }
|
||||
public List<string> problemheight { get; set; } = new List<string>();
|
||||
public List<string> diaoluowu { get; set; } = new List<string>();
|
||||
}
|
||||
public class ProblemToward
|
||||
{
|
||||
public string Toward { get; set; }
|
||||
public string file { get; set; }
|
||||
}
|
||||
public class Mapper : IRegister
|
||||
{
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.ForType<SanjuBuilding, outside_wall_building>()
|
||||
.Map(dest => dest.curwallproblems, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.curwallproblems))
|
||||
.Map(dest => dest.problemseason, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.problemseason))
|
||||
.Map(dest => dest.wallproblemtoward, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.wallproblemtoward))
|
||||
//.Map(dest => dest.problemfiles, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.problemfiles))
|
||||
.Map(dest => dest.problemheight, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.problemheight))
|
||||
.Map(dest => dest.diaoluowu, src => Newtonsoft.Json.JsonConvert.SerializeObject(src.diaoluowu));
|
||||
}
|
||||
}
|
||||
}
|
||||
106
20220330_Vote/Vote.Services/Entities/outside_wall.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Vote.Services.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class outside_wall
|
||||
{
|
||||
/// <summary>
|
||||
/// Id主键
|
||||
/// </summary>
|
||||
[DisplayName("Id主键")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 社区id,关联三居系统社区id
|
||||
/// </summary>
|
||||
[DisplayName("社区id,关联三居系统社区id")]
|
||||
public string communityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 社区/小区名称
|
||||
/// </summary>
|
||||
[DisplayName("社区/小区名称")]
|
||||
public string communityName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交付年份
|
||||
/// </summary>
|
||||
[DisplayName("交付年份")]
|
||||
public string deliveryear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 楼栋数
|
||||
/// </summary>
|
||||
[DisplayName("楼栋数")]
|
||||
public decimal buildcount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 住户总数
|
||||
/// </summary>
|
||||
[DisplayName("住户总数")]
|
||||
public decimal? householdcount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总建筑面积
|
||||
/// </summary>
|
||||
[DisplayName("总建筑面积")]
|
||||
public decimal? totalfloorage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在外墙问题
|
||||
/// </summary>
|
||||
[DisplayName("是否存在外墙问题")]
|
||||
public int? isExistProblem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题发生后是否请人修复了
|
||||
/// </summary>
|
||||
[DisplayName("问题发生后是否请人修复了")]
|
||||
public int? problemismodify { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请提供修复单位的名称
|
||||
/// </summary>
|
||||
[DisplayName("请提供修复单位的名称")]
|
||||
public string problemmodifyunitname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修复后的部位是否再次发生问题
|
||||
/// </summary>
|
||||
[DisplayName("修复后的部位是否再次发生问题")]
|
||||
public int? problemmodifyisagain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系方式
|
||||
/// </summary>
|
||||
[DisplayName("联系方式")]
|
||||
public string contract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// createtime
|
||||
/// </summary>
|
||||
[DisplayName("createtime")]
|
||||
public DateTime? createtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// isdeleted
|
||||
/// </summary>
|
||||
[DisplayName("isdeleted")]
|
||||
public int? isdeleted { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<outside_wall_photo> outside_wall_photos { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<outside_wall_building> outside_wall_buildings { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
159
20220330_Vote/Vote.Services/Entities/outside_wall_building.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Vote.Services.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class outside_wall_building
|
||||
{
|
||||
/// <summary>
|
||||
/// Id主键
|
||||
/// </summary>
|
||||
[DisplayName("Id主键")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外墙id
|
||||
/// </summary>
|
||||
[DisplayName("外墙id")]
|
||||
public string outsidewallId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 幢Id 关联三居幢id
|
||||
/// </summary>
|
||||
[DisplayName("幢Id 关联三居幢id")]
|
||||
public string BuildingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 幢名称
|
||||
/// </summary>
|
||||
[DisplayName("幢名称")]
|
||||
public string BuildingName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
[DisplayName("地址")]
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 层数
|
||||
/// </summary>
|
||||
[DisplayName("层数")]
|
||||
public int? LevelCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总户数
|
||||
/// </summary>
|
||||
[DisplayName("总户数")]
|
||||
public int? Households { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 建设单位
|
||||
/// </summary>
|
||||
[DisplayName("建设单位")]
|
||||
public string BuildingUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设计单位
|
||||
/// </summary>
|
||||
[DisplayName("设计单位")]
|
||||
public string DesingerUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 施工单位
|
||||
/// </summary>
|
||||
[DisplayName("施工单位")]
|
||||
public string ConstructionUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 监理单位
|
||||
/// </summary>
|
||||
[DisplayName("监理单位")]
|
||||
public string MonitorUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物业单位
|
||||
/// </summary>
|
||||
[DisplayName("物业单位")]
|
||||
public string WuYeUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 墙体问题的类型是
|
||||
/// </summary>
|
||||
[DisplayName("墙体问题的类型是")]
|
||||
public string curwallproblems { get; set; }
|
||||
/// <summary>
|
||||
/// 墙体问题的类型-其他
|
||||
/// </summary>
|
||||
[DisplayName("墙体问题的类型-其他")]
|
||||
public string curwallproblemother { get; set; }
|
||||
/// <summary>
|
||||
/// 哪个问题最先开始出现
|
||||
/// </summary>
|
||||
[DisplayName("哪个问题最先开始出现")]
|
||||
public string wallproblemsfirst { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 第一次出现墙体问题是建成后____年
|
||||
/// </summary>
|
||||
[DisplayName("第一次出现墙体问题是建成后____年")]
|
||||
public string firstproblemdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 墙体脱落发生频率如何
|
||||
/// </summary>
|
||||
[DisplayName("墙体脱落发生频率如何")]
|
||||
public string problemfrequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 问题多发生在哪个季节
|
||||
/// </summary>
|
||||
[DisplayName("问题多发生在哪个季节")]
|
||||
public string problemseason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 墙体问题发生的朝向是哪面
|
||||
/// </summary>
|
||||
[DisplayName("墙体问题发生的朝向是哪面")]
|
||||
public string wallproblemtoward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发生外墙问题的范围有多大
|
||||
/// </summary>
|
||||
[DisplayName("发生外墙问题的范围有多大")]
|
||||
public string problemfanwei { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外墙问题发生在哪个高度
|
||||
/// </summary>
|
||||
[DisplayName("外墙问题发生在哪个高度")]
|
||||
public string problemheight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 掉落物是什么
|
||||
/// </summary>
|
||||
[DisplayName("掉落物是什么")]
|
||||
public string diaoluowu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// createtime
|
||||
/// </summary>
|
||||
[DisplayName("createtime")]
|
||||
public DateTime? createtime { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<outside_wall_building_photo> outside_wall_building_photos { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Vote.Services.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class outside_wall_building_photo
|
||||
{
|
||||
/// <summary>
|
||||
/// 朝向
|
||||
/// </summary>
|
||||
[DisplayName("朝向")]
|
||||
public string toward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// outsidewallBuildingId
|
||||
/// </summary>
|
||||
[DisplayName("outsidewallBuildingId")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string outsidewallBuildingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// sysfileid
|
||||
/// </summary>
|
||||
[DisplayName("sysfileid")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string sysfileid { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
36
20220330_Vote/Vote.Services/Entities/outside_wall_photo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Vote.Services.Entities
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class outside_wall_photo
|
||||
{
|
||||
/// <summary>
|
||||
/// outsidewallId
|
||||
/// </summary>
|
||||
[DisplayName("outsidewallId")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string outsidewallId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// sysfileid
|
||||
/// </summary>
|
||||
[DisplayName("sysfileid")]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string sysfileid { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,80 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Vote.Services.ApiController.OutsideWallService">
|
||||
<summary>
|
||||
外墙调查问卷
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.#ctor(Ewide.Core.SqlSugarRepository{Vote.Services.Entities.outside_wall},Ewide.Core.SqlSugarRepository{Vote.Services.Entities.outside_wall_building},Ewide.Core.SqlSugarRepository{Vote.Services.Entities.outside_wall_building_photo},Ewide.Core.SqlSugarRepository{Vote.Services.Entities.outside_wall_photo},Microsoft.Extensions.Caching.Memory.IMemoryCache,Ewide.Core.SqlSugarRepository{Ewide.Core.SysFile},Microsoft.Extensions.Options.IOptions{Ewide.Core.UploadFileOptions})">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="_repoutside_wall"></param>
|
||||
<param name="_repoutside_wall_building"></param>
|
||||
<param name="_repoutside_wall_building_photo"></param>
|
||||
<param name="_repoutside_wall_photo"></param>
|
||||
<param name="memoryCache"></param>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.Query(System.String)">
|
||||
<summary>
|
||||
获取三居系统中的社区
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.GetCommunitys(System.String)">
|
||||
<summary>
|
||||
获取三居系统中的社区
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.GetCommunityInfo(System.String)">
|
||||
<summary>
|
||||
获取三居系统中的社区
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.GetTimeStamp">
|
||||
<summary>
|
||||
获取时间戳
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.UploadFileDefault(Microsoft.AspNetCore.Http.IFormFile)">
|
||||
<summary>
|
||||
上传文件
|
||||
</summary>
|
||||
<param name="file"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.DeleteFile(System.String)">
|
||||
<summary>
|
||||
删除文件
|
||||
</summary>
|
||||
<param name="file"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.PreviewFileInfo(System.String)">
|
||||
<summary>
|
||||
预览文件
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.UploadFile(Microsoft.AspNetCore.Http.IFormFile,Ewide.Core.FileDescription)">
|
||||
<summary>
|
||||
上传文件
|
||||
</summary>
|
||||
<param name="file"></param>
|
||||
<param name="pathType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Vote.Services.ApiController.OutsideWallService.Submit(Vote.Services.Dto.OutsideWallInput)">
|
||||
<summary>
|
||||
提交
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Vote.Services.ApiController.ProjectsService">
|
||||
<summary>
|
||||
项目
|
||||
@@ -315,6 +389,16 @@
|
||||
希望上传到的目录和文件名 , 如果为空则上传到根目录 ,大小写敏感! ,斜杠必须使用/ , eg: files/COC/202011/11/2020KDFJ0075.pdf
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Dto.OutsideWallInput">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Dto.OutsideWallInput.communityName">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Dto.ProjectsInput.type">
|
||||
<summary>
|
||||
项目类型
|
||||
@@ -520,6 +604,236 @@
|
||||
过期时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Entities.outside_wall">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.Id">
|
||||
<summary>
|
||||
Id主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.communityId">
|
||||
<summary>
|
||||
社区id,关联三居系统社区id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.communityName">
|
||||
<summary>
|
||||
社区/小区名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.deliveryear">
|
||||
<summary>
|
||||
交付年份
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.buildcount">
|
||||
<summary>
|
||||
楼栋数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.householdcount">
|
||||
<summary>
|
||||
住户总数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.totalfloorage">
|
||||
<summary>
|
||||
总建筑面积
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.isExistProblem">
|
||||
<summary>
|
||||
是否存在外墙问题
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.problemismodify">
|
||||
<summary>
|
||||
问题发生后是否请人修复了
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.problemmodifyunitname">
|
||||
<summary>
|
||||
请提供修复单位的名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.problemmodifyisagain">
|
||||
<summary>
|
||||
修复后的部位是否再次发生问题
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.contract">
|
||||
<summary>
|
||||
联系方式
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.createtime">
|
||||
<summary>
|
||||
createtime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall.isdeleted">
|
||||
<summary>
|
||||
isdeleted
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Entities.outside_wall_building">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.Id">
|
||||
<summary>
|
||||
Id主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.outsidewallId">
|
||||
<summary>
|
||||
外墙id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.BuildingId">
|
||||
<summary>
|
||||
幢Id 关联三居幢id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.BuildingName">
|
||||
<summary>
|
||||
幢名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.Address">
|
||||
<summary>
|
||||
地址
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.LevelCount">
|
||||
<summary>
|
||||
层数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.Households">
|
||||
<summary>
|
||||
总户数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.BuildingUnit">
|
||||
<summary>
|
||||
建设单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.DesingerUnit">
|
||||
<summary>
|
||||
设计单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.ConstructionUnit">
|
||||
<summary>
|
||||
施工单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.MonitorUnit">
|
||||
<summary>
|
||||
监理单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.WuYeUnit">
|
||||
<summary>
|
||||
物业单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.curwallproblems">
|
||||
<summary>
|
||||
墙体问题的类型是
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.curwallproblemother">
|
||||
<summary>
|
||||
墙体问题的类型-其他
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.wallproblemsfirst">
|
||||
<summary>
|
||||
哪个问题最先开始出现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.firstproblemdate">
|
||||
<summary>
|
||||
第一次出现墙体问题是建成后____年
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.problemfrequency">
|
||||
<summary>
|
||||
墙体脱落发生频率如何
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.problemseason">
|
||||
<summary>
|
||||
问题多发生在哪个季节
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.wallproblemtoward">
|
||||
<summary>
|
||||
墙体问题发生的朝向是哪面
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.problemfanwei">
|
||||
<summary>
|
||||
发生外墙问题的范围有多大
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.problemheight">
|
||||
<summary>
|
||||
外墙问题发生在哪个高度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.diaoluowu">
|
||||
<summary>
|
||||
掉落物是什么
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building.createtime">
|
||||
<summary>
|
||||
createtime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Entities.outside_wall_building_photo">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building_photo.toward">
|
||||
<summary>
|
||||
朝向
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building_photo.outsidewallBuildingId">
|
||||
<summary>
|
||||
outsidewallBuildingId
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_building_photo.sysfileid">
|
||||
<summary>
|
||||
sysfileid
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Entities.outside_wall_photo">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_photo.outsidewallId">
|
||||
<summary>
|
||||
outsidewallId
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Vote.Services.Entities.outside_wall_photo.sysfileid">
|
||||
<summary>
|
||||
sysfileid
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Vote.Services.Entities.Projects">
|
||||
<summary>
|
||||
项目表
|
||||
|
||||