init
This commit is contained in:
commit
c24f9da7bd
|
|
@ -0,0 +1,5 @@
|
|||
# 2010
|
||||
*.txt -crlf
|
||||
|
||||
# 2020
|
||||
*.txt text eol=lf
|
||||
|
|
@ -0,0 +1,258 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
*.DS_Store
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
logs/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
results/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
.vscode/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
site/wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Microsoft Azure ApplicationInsights config file
|
||||
ApplicationInsights.config
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
!idsrv3test.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
!tools/packages.config
|
||||
tools/
|
||||
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
# Ocelot acceptance test config
|
||||
test/Ocelot.AcceptanceTests/ocelot.json
|
||||
|
||||
# Read the docstates
|
||||
_build/
|
||||
_static/
|
||||
_templates/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
|
||||
# Test Results
|
||||
*.trx
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="QRCoder" Version="1.4.1" />
|
||||
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta19" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta15" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.ImageSharp.V2" Version="0.16.15" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace Crm.Core.Common.Helpers
|
||||
{
|
||||
|
||||
public class AliHelper
|
||||
{
|
||||
private string AccessKeyId = ""; //密钥ID
|
||||
private string AccessKeySecret = "";
|
||||
private string Format = "JSON"; //返回值的类型
|
||||
private string Version = ""; //API版本号
|
||||
private string Signature = ""; //签名结果串
|
||||
private string SignatureMethod = "HMAC-SHA1"; //签名方式,目前支持HMAC-SHA1
|
||||
private string Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"); //请求的时间戳 日期格式按照ISO8601标准表示,并需要使用UTC时间 yyyy-MM-ddTHH:mm:ssZ;
|
||||
private string SignatureVersion = "1.0"; //签名算法版本
|
||||
private string SignatureNonce = Guid.NewGuid().ToString(); //唯一随机数,用于防止网络重放攻击。用户在不同请求间要使用不同的随机数值
|
||||
|
||||
public AliHelper(string AccessKeyId, string AccessKeySecret, string Version)
|
||||
{
|
||||
this.AccessKeyId = AccessKeyId;
|
||||
this.AccessKeySecret = AccessKeySecret;
|
||||
this.Version = Version;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算签名
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
private void ComputeSignature(Dictionary<string, object> ditParam, string method = "GET")
|
||||
{
|
||||
BuildParameters(ditParam);
|
||||
|
||||
//按ascii码排序
|
||||
Dictionary<string, object> asciiDit = new Dictionary<string, object>();
|
||||
string[] KeyArr = ditParam.Keys.ToArray();
|
||||
Array.Sort(KeyArr, string.CompareOrdinal);
|
||||
foreach (var key in KeyArr)
|
||||
{
|
||||
string value = ditParam[key].ToString();
|
||||
asciiDit.Add(key, value);
|
||||
}
|
||||
|
||||
|
||||
//计算签名
|
||||
var canonicalizedQueryString = string.Join("&",
|
||||
asciiDit.Select(x => PercentEncode(x.Key) + "=" + PercentEncode(x.Value.ToString())));
|
||||
|
||||
var stringToSign = method.ToString().ToUpper() + "&" + PercentEncode("/") + "&" + PercentEncode(canonicalizedQueryString);
|
||||
var keyBytes = Encoding.UTF8.GetBytes(AccessKeySecret + "&");
|
||||
var hmac = new HMACSHA1(keyBytes);
|
||||
var hashBytes = hmac.ComputeHash(Encoding.UTF8.GetBytes(stringToSign));
|
||||
Signature = Convert.ToBase64String(hashBytes);
|
||||
|
||||
|
||||
ditParam.Add("Signature", Signature);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//获取公共参数和相关方法中的参数
|
||||
private void BuildParameters(Dictionary<string, object> ditParam)
|
||||
{
|
||||
ditParam.Add("Format", Format.ToUpper());
|
||||
ditParam.Add("Version", Version);
|
||||
ditParam.Add("AccessKeyId", AccessKeyId);
|
||||
ditParam.Add("Timestamp", Timestamp);
|
||||
ditParam.Add("SignatureMethod", SignatureMethod);
|
||||
ditParam.Add("SignatureVersion", SignatureVersion);
|
||||
ditParam.Add("SignatureNonce", SignatureNonce);
|
||||
}
|
||||
|
||||
|
||||
private string PercentEncode(string value)
|
||||
{
|
||||
return UpperCaseUrlEncode(value)
|
||||
.Replace("/", "%2F")
|
||||
.Replace("+", "%20")
|
||||
.Replace("*", "%2A")
|
||||
.Replace("%7E", "~")
|
||||
.Replace("!", "%21")
|
||||
.Replace("'", "%27")
|
||||
.Replace("(", "%28")
|
||||
.Replace(")", "%29");
|
||||
}
|
||||
|
||||
private string UpperCaseUrlEncode(string s)
|
||||
{
|
||||
// C# 的 HttpUtility.UrlEncode() 编码得到的形如 %xx%xx的内容是小写的,Java 的是大写的。
|
||||
char[] temp = HttpUtility.UrlEncode(s).ToCharArray();
|
||||
for (int i = 0; i < temp.Length - 2; i++)
|
||||
{
|
||||
if (temp[i] == '%')
|
||||
{
|
||||
temp[i + 1] = char.ToUpper(temp[i + 1]);
|
||||
temp[i + 2] = char.ToUpper(temp[i + 2]);
|
||||
}
|
||||
}
|
||||
return new string(temp);
|
||||
}
|
||||
|
||||
|
||||
public string HttpGetUrl(string Url, Dictionary<string, object> ditParam)
|
||||
{
|
||||
ComputeSignature(ditParam);
|
||||
var param = string.Join("&", ditParam.Select(x => x.Key + "=" + HttpUtility.UrlEncode(x.Value.ToString())));
|
||||
|
||||
var u = Url + (param == "" ? "" : "?") + param;
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(u);
|
||||
request.Method = "GET";
|
||||
request.ContentType = "text/html;charset=UTF-8";
|
||||
HttpWebResponse response;
|
||||
try
|
||||
{
|
||||
response = (HttpWebResponse)request.GetResponse();
|
||||
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
response = (HttpWebResponse)ex.Response;
|
||||
}
|
||||
|
||||
Stream myResponseStream = response.GetResponseStream();
|
||||
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
|
||||
string retString = myStreamReader.ReadToEnd();
|
||||
myStreamReader.Close();
|
||||
myResponseStream.Close();
|
||||
return retString;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public class Credentials
|
||||
{
|
||||
public string SecurityToken { get; set; }
|
||||
public string AccessKeyId { get; set; }
|
||||
public string AccessKeySecret { get; set; }
|
||||
public string Expiration { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
using SixLabors.Fonts;
|
||||
using SixLabors.ImageSharp.Drawing.Processing;
|
||||
using SixLabors.ImageSharp.Formats.Png;
|
||||
using ZXing;
|
||||
|
||||
namespace Crm.Core.Common.Helpers
|
||||
{
|
||||
public class QRCodeHelper
|
||||
{
|
||||
public byte[] Create(string content, int width)
|
||||
{
|
||||
var writer = new ZXing.ImageSharp.BarcodeWriter<Rgba32>
|
||||
{
|
||||
Format = BarcodeFormat.QR_CODE,
|
||||
Options = new ZXing.QrCode.QrCodeEncodingOptions
|
||||
{
|
||||
DisableECI = true,
|
||||
CharacterSet = "UTF-8",
|
||||
Width = width,
|
||||
Height = width,
|
||||
Margin = 1
|
||||
}
|
||||
};
|
||||
var image = writer.WriteAsImageSharp<Rgba32>(content);
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
image.Save(ms, new PngEncoder());
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Create(string content, int width, string bg, int x, int y)
|
||||
{
|
||||
var qrcode = Create(content, width);
|
||||
var qrcode_img = Image.Load(qrcode);
|
||||
var bg_img = Image.Load(bg);
|
||||
bg_img.Mutate(m => m.DrawImage(qrcode_img, new Point(x, y), 1));
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bg_img.SaveAsPngAsync(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成二维码
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="bg"></param>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="title_x">-1表示自动居中</param>
|
||||
/// <param name="title_y"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] Create(string content, int width, string bg, int x, int y, string title, int title_x, int title_y)
|
||||
{
|
||||
var qrcode = Create(content, width);
|
||||
var qrcode_img = Image.Load(qrcode);
|
||||
var bg_img = Image.Load(bg);
|
||||
bg_img.Mutate(m => m.DrawImage(qrcode_img, new Point(x, y), 1));
|
||||
var fonts = new FontCollection();
|
||||
var fontFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "fonts", "SIMHEI.TTF");
|
||||
var fontFamily = fonts.Add(fontFile);
|
||||
var font = new Font(fontFamily, 14, FontStyle.Bold);
|
||||
if (title_x<0)
|
||||
{
|
||||
var fontRect = TextMeasurer.Measure(title, new TextOptions(font));
|
||||
title_x = Convert.ToInt32(0.5*bg_img.Width) - Convert.ToInt32(0.5*fontRect.Width);
|
||||
}
|
||||
bg_img.Mutate(m => m.DrawText(title, font, Color.White, new PointF(title_x, title_y)));
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bg_img.SaveAsPngAsync(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成二维码
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="bg"></param>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="title_x">-1表示自动居中</param>
|
||||
/// <param name="title_y"></param>
|
||||
/// <param name="subtitle"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] Create(string content, int width, string bg, int x, int y, string title, int title_x, int title_y, string subtitle)
|
||||
{
|
||||
var qrcode = Create(content, width);
|
||||
var qrcode_img = Image.Load(qrcode);
|
||||
var bg_img = Image.Load(bg);
|
||||
bg_img.Mutate(m => m.DrawImage(qrcode_img, new Point(x, y), 1));
|
||||
var fonts = new FontCollection();
|
||||
var fontFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", "fonts", "SIMHEI.TTF");
|
||||
var fontFamily = fonts.Add(fontFile);
|
||||
var font = new Font(fontFamily, 14, FontStyle.Bold);
|
||||
var subtitle_x = 0;
|
||||
var subtitle_y = 0;
|
||||
if (title_x<0)
|
||||
{
|
||||
var fontRect = TextMeasurer.Measure(title, new TextOptions(font));
|
||||
title_x = Convert.ToInt32(0.5*bg_img.Width) - Convert.ToInt32(0.5*fontRect.Width);
|
||||
|
||||
var fontRect2 = TextMeasurer.Measure(subtitle, new TextOptions(font));
|
||||
subtitle_x = Convert.ToInt32(0.5*bg_img.Width) - Convert.ToInt32(0.5*fontRect2.Width);
|
||||
subtitle_y = Convert.ToInt32(fontRect.Height) + title_y + 10;
|
||||
}
|
||||
bg_img.Mutate(m => m.DrawText(title, font, Color.White, new PointF(title_x, title_y)));
|
||||
bg_img.Mutate(m => m.DrawText(subtitle, font, Color.White, new PointF(subtitle_x, subtitle_y)));
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bg_img.SaveAsPngAsync(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,957 @@
|
|||
using Crm.Core.Domain.Dto.Customer;
|
||||
using Crm.Core.Domain.Impl;
|
||||
using Crm.Core.Entity.Crm;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using MySqlConnector;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Crm.Core.Domain.Config.SystemEnums;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
public class CacheDomain : ICacheDomain
|
||||
{
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IAppManager _appManager;
|
||||
private readonly IRedisManager _redisManager;
|
||||
private readonly IOracleRepository<CrmDbContext> _repository;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly SystemConfig _systemConfig;
|
||||
private readonly IHttpContextAccessor _httpContext;
|
||||
|
||||
public CacheDomain(IRedisManager redisManager,
|
||||
IOracleRepository<CrmDbContext> repository,
|
||||
IMapper mapper,
|
||||
IConfiguration configuration,
|
||||
IHttpContextAccessor httpContext,
|
||||
IHttpClient httpClient,
|
||||
IAppManager appManager)
|
||||
{
|
||||
_redisManager = redisManager;
|
||||
_repository = repository;
|
||||
_mapper = mapper;
|
||||
_configuration = configuration;
|
||||
_systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
_httpContext = httpContext;
|
||||
_httpClient = httpClient;
|
||||
_appManager = appManager;
|
||||
}
|
||||
|
||||
private async Task<List<BAS_PARAMETER>> GetParameterList(string appid)
|
||||
{
|
||||
var key = $"{CacheKeys.ParameterList}_{appid}";
|
||||
if (!await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
var list = await _repository.GetRepository<BAS_PARAMETER>().QueryListAsync();
|
||||
await _redisManager.SetAsync(key, list, TimeSpan.FromDays(1));
|
||||
return list;
|
||||
}
|
||||
else
|
||||
{
|
||||
return await _redisManager.GetListAsync<BAS_PARAMETER>(key);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetValueParameter(string key)
|
||||
{
|
||||
var list = await GetParameterList(GetApp());
|
||||
return list.FirstOrDefault(x => x.PARAKEY == key)?.PARAVALUE ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetValueParameter(ParameterEnums key)
|
||||
{
|
||||
var list = await GetParameterList(GetApp());
|
||||
return list.FirstOrDefault(x => x.PARAKEY == key.ToString())?.PARAVALUE ?? "";
|
||||
}
|
||||
|
||||
public async Task<T> GetParameter<T>(string key) where T : new()
|
||||
{
|
||||
var list = await GetParameterList(GetApp());
|
||||
var value = list.FirstOrDefault(x => x.PARAKEY == key)?.PARAVALUE ?? "";
|
||||
return string.IsNullOrEmpty(value) ? new T() : JsonSerializer.Deserialize<T>(value);
|
||||
}
|
||||
|
||||
public async Task<T> GetParameter<T>(ParameterEnums key) where T : new()
|
||||
{
|
||||
var list = await GetParameterList(GetApp());
|
||||
var value = list.FirstOrDefault(x => x.PARAKEY == key.ToString())?.PARAVALUE ?? "";
|
||||
return string.IsNullOrEmpty(value) ? new T() : JsonSerializer.Deserialize<T>(value);
|
||||
}
|
||||
|
||||
public async Task<bool> SetApp(IOracleRepository<CrmDbContext> repository, decimal deptmentId)
|
||||
{
|
||||
var apps = _systemConfig.Apps;
|
||||
Log.Information($"事业部切换,deptmentId:{deptmentId}");
|
||||
if (apps.All(x => !x.Deptids.Contains(deptmentId)))
|
||||
{
|
||||
Log.Information($"事业部切换失败,deptmentId:{deptmentId}");
|
||||
return false;
|
||||
}
|
||||
var app = apps.Where(x => x.Deptids.Contains(deptmentId)).Select(x => x.Appid).FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(app))
|
||||
{
|
||||
await repository.SetConnectionString(app);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<bool> SetApp(IOracleRepository<CrmDbContext> repository, string appid)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(appid))
|
||||
{
|
||||
await repository.SetConnectionString(appid);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<List<decimal>> GetDeptmentIdByApp(string app)
|
||||
{
|
||||
var apps = _systemConfig.Apps;
|
||||
if (apps.All(x => x.Appid != app))
|
||||
{
|
||||
return new List<decimal>();
|
||||
}
|
||||
var deptids = apps.Where(x => x.Appid == app).Select(x => x.Deptids).FirstOrDefault();
|
||||
if (deptids != null)
|
||||
{
|
||||
return await Task.FromResult(deptids);
|
||||
}
|
||||
return new List<decimal>();
|
||||
}
|
||||
|
||||
public async Task<string> GetAppidByDeptmentId(decimal deptmentId)
|
||||
{
|
||||
var apps = _systemConfig.Apps;
|
||||
if (apps.All(x => !x.Deptids.Contains(deptmentId)))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
var appid = apps.Where(x => x.Deptids.Contains(deptmentId)).Select(x => x.Appid).FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(appid))
|
||||
{
|
||||
return await Task.FromResult(appid);
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public async Task<decimal> GetCurrentEid()
|
||||
{
|
||||
var appid = GetApp();
|
||||
var values = new StringValues();
|
||||
_httpContext?.HttpContext?.Request.Headers.TryGetValue("token", out values);
|
||||
var authToken = values.ToString();
|
||||
var eid = decimal.Zero;
|
||||
if (string.IsNullOrEmpty(authToken))
|
||||
{
|
||||
_httpContext?.HttpContext?.Request.Headers.TryGetValue("eid", out values);
|
||||
if (string.IsNullOrEmpty(values.ToString()) || !decimal.TryParse(values.ToString(), out eid))
|
||||
{
|
||||
return eid;
|
||||
}
|
||||
}
|
||||
if (eid == 0)
|
||||
{
|
||||
var data = new
|
||||
{
|
||||
appId = appid,
|
||||
grantType = 1,
|
||||
token = authToken
|
||||
};
|
||||
|
||||
var response = await _httpClient.PostAsync<RetResult<SsoResponseDataDto>>($"{_systemConfig.GetSsoTokenUrl()}", data);
|
||||
|
||||
if (response == null || response.Ret != 0 || !response.Data.EmployeeId.HasValue)
|
||||
{
|
||||
return eid;
|
||||
}
|
||||
else
|
||||
{
|
||||
return response.Data.EmployeeId.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return eid;
|
||||
}
|
||||
|
||||
public async Task<List<decimal>> GetDeptmentIds()
|
||||
{
|
||||
var eid = await GetCurrentEid();
|
||||
var data = await GetDeptmentIdsByEid(eid);
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<List<decimal>> GetDeptmentIdsByEid(decimal eid)
|
||||
{
|
||||
var appid = GetApp();
|
||||
|
||||
if (eid == 0)
|
||||
{
|
||||
return new List<decimal>();
|
||||
}
|
||||
|
||||
var key = $"{CacheKeys.UserInfo}_{appid}_{eid}";
|
||||
if (await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
var data = await _redisManager.GetListAsync<decimal>(key);
|
||||
Log.Information($"getdeptids{eid}_{string.Join(",", data)}");
|
||||
return data;
|
||||
}
|
||||
|
||||
var businessIds = new List<decimal>();
|
||||
var businessId = decimal.Zero;
|
||||
|
||||
// 获取员工所属部门事业线ID
|
||||
var sql = @"select
|
||||
a.businessid,
|
||||
b.businessname,
|
||||
b.channel
|
||||
from
|
||||
(
|
||||
select
|
||||
*
|
||||
from
|
||||
bas_businessdepartment
|
||||
where
|
||||
deptid in (
|
||||
select
|
||||
saledeptid
|
||||
from
|
||||
bas_salesdepartment start with saledeptid =(
|
||||
select
|
||||
a.deptid
|
||||
from
|
||||
bas_innerusergroup a
|
||||
join bas_inneruser b on a.inneruserid = b.pkid
|
||||
where
|
||||
b.eid = :eid
|
||||
) connect by prior department_parentid = department_id
|
||||
)
|
||||
) a
|
||||
join bas_businesslines b on a.businessid = b.businessid";
|
||||
var param = new OracleParameter[] {
|
||||
new OracleParameter() { ParameterName = ":eid", OracleDbType = OracleDbType.Int64, Value = eid }
|
||||
};
|
||||
var business = await _repository.ExecuteSqlToEntityAsync<BusinessDto>(sql, param);
|
||||
if (business != null && business.Businessid != null) businessId = business.Businessid.Value;
|
||||
|
||||
if (businessId == 0)
|
||||
{
|
||||
var user = await _repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Include(x => x.BAS_INNERUSERGROUP)
|
||||
.Include(x => x.BAS_INNERUSERGROUP.BAS_SALESDEPARTMENT)
|
||||
.Include(x => x.BAS_INNERUSERGROUP.BAS_SALESDEPARTMENT.BAS_BUSINESSDEPARTMENT)
|
||||
.Where(x => x.EID == eid)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (user == null || user.BAS_INNERUSERGROUP == null || user.BAS_INNERUSERGROUP.BAS_SALESDEPARTMENT == null)
|
||||
{
|
||||
return new List<decimal>();
|
||||
}
|
||||
|
||||
var sales = user.BAS_INNERUSERGROUP.BAS_SALESDEPARTMENT;
|
||||
var parent = true;
|
||||
var count = 0;
|
||||
while (parent)
|
||||
{
|
||||
if (sales.DEPARTMENT_PARENTID == null || count > 5)
|
||||
{
|
||||
var apps = _systemConfig.Apps;
|
||||
var deptids = apps.Where(x => x.Appid == appid).Select(x => x.Deptids).FirstOrDefault();
|
||||
if (deptids != null && deptids.Any())
|
||||
{
|
||||
businessIds.AddRange(deptids);
|
||||
break;
|
||||
}
|
||||
return new List<decimal>();
|
||||
}
|
||||
count++;
|
||||
if (sales.BAS_BUSINESSDEPARTMENT != null)
|
||||
{
|
||||
parent = false;
|
||||
businessIds.Add(sales.BAS_BUSINESSDEPARTMENT.BUSINESSID);
|
||||
}
|
||||
else
|
||||
{
|
||||
sales = await _repository.GetRepository<BAS_SALESDEPARTMENT>().Query()
|
||||
.Include(x => x.BAS_BUSINESSDEPARTMENT)
|
||||
.FirstOrDefaultAsync(x => x.DEPARTMENT_ID == sales.DEPARTMENT_PARENTID);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
businessIds.Add(businessId);
|
||||
}
|
||||
|
||||
// 获取员工数据权限配置的部门对应的事业线ID
|
||||
var inneruser = await _repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Include(x => x.BAS_GROUPLEADER)
|
||||
.Where(x => x.EID == eid)
|
||||
.FirstOrDefaultAsync();
|
||||
if (inneruser == null || inneruser.BAS_GROUPLEADER == null)
|
||||
{
|
||||
businessIds = businessIds.Where(x => x != 0).ToList();
|
||||
await _redisManager.SetAsync(key, businessIds, TimeSpan.FromMinutes(30));
|
||||
return businessIds;
|
||||
}
|
||||
// 如果有全部数据权限,返回所有事业线ID
|
||||
/* if (inneruser.BAS_GROUPLEADER.Select(n => n.INNERGROUPID).Contains(0))
|
||||
{
|
||||
var apps = _systemConfig.Apps;
|
||||
var deptids = apps.Where(x => x.Appid == appid).Select(x => x.Deptids).FirstOrDefault();
|
||||
if (deptids != null && deptids.Any())
|
||||
{
|
||||
businessIds.AddRange(deptids);
|
||||
}
|
||||
businessIds = businessIds.Where(x => x != 0).Distinct().ToList();
|
||||
await _redisManager.SetAsync(key, businessIds, TimeSpan.FromMinutes(30));
|
||||
return businessIds;
|
||||
}*/
|
||||
var userId = inneruser.PKID;
|
||||
var groupids = inneruser.BAS_GROUPLEADER.Where(x => x.TYPE == 0).Select(x => x.INNERGROUPID).ToList();
|
||||
var depts = await _repository.GetRepository<BAS_INNERGROUP>().Query()
|
||||
.Where(n => groupids.Contains(n.GID) && n.SALEDEPTID.HasValue)
|
||||
.Select(n => n.SALEDEPTID.Value)
|
||||
.ToListAsync();
|
||||
var leadDept = inneruser.BAS_GROUPLEADER.Where(x => x.TYPE == 1).Select(x => x.INNERGROUPID).ToList();
|
||||
if (leadDept != null && leadDept.Any())
|
||||
{
|
||||
depts.AddRange(leadDept);
|
||||
}
|
||||
var seftdept = await _repository.GetRepository<BAS_INNERUSERGROUP>().Query().FirstOrDefaultAsync(n => userId == n.INNERUSERID);
|
||||
if (seftdept != null && seftdept.DEPTID.HasValue)
|
||||
{
|
||||
depts.Add(seftdept.DEPTID.Value);
|
||||
}
|
||||
depts = depts.Distinct().ToList();
|
||||
foreach (var item in depts)
|
||||
{
|
||||
var deptList = GetParentDeptId(item);
|
||||
List<decimal> ALLdeptIDS = new List<decimal>();
|
||||
List<decimal> ALLgidS = new List<decimal>();
|
||||
//向下遍历
|
||||
GetAllDeptIDOrGidByDeptStr(item.ToString(), ref ALLdeptIDS, ref ALLgidS);
|
||||
deptList.AddRange(ALLdeptIDS);
|
||||
var bussinessIds = await _repository.GetRepository<BAS_BUSINESSDEPARTMENT>().Query().Where(n => deptList.Contains(n.DEPTID)).Select(x => x.BUSINESSID).ToListAsync();
|
||||
businessIds.AddRange(bussinessIds);
|
||||
}
|
||||
|
||||
businessIds = businessIds.Where(x => x != 0).Distinct().ToList();
|
||||
|
||||
await _redisManager.SetAsync(key, businessIds, TimeSpan.FromMinutes(30));
|
||||
Log.Information($"getdeptids{eid}_{string.Join(",", businessIds)}");
|
||||
return businessIds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据特殊权限查找权限
|
||||
/// </summary>
|
||||
/// <param name="eid"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<List<decimal>> GetSpecialDeptmentIdsByRightCode(string rightcode)
|
||||
{
|
||||
var businessIds = new List<decimal>();
|
||||
try
|
||||
{
|
||||
var eid = await GetCurrentEid();
|
||||
var appid = GetApp();
|
||||
if (eid == 0)
|
||||
{
|
||||
return new List<decimal>();
|
||||
}
|
||||
|
||||
var key = $"{CacheKeys.UserInfo}_{appid}_special_{rightcode}_{eid}";//特殊权限缓存
|
||||
if (await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
return await _redisManager.GetListAsync<decimal>(key);
|
||||
}
|
||||
|
||||
|
||||
var businessId = decimal.Zero;
|
||||
|
||||
var sql1 = @"select a.inneruserid,b.code,b.roleid,c.eid,c.uname,d.rightid,d.rname,d.remarks,e.typeid,e.cid from bas_inneruserrole a
|
||||
left join bas_role b on a.roleid=b.roleid
|
||||
left join bas_inneruser c on c.pkid=a.inneruserid
|
||||
left join bas_right_level d on d.rolecode=b.code
|
||||
left join bas_right_level_detail e on e.levelid=d.pkid
|
||||
where c.eid=:eid and d.rightid=:rightcode";
|
||||
|
||||
var param1 = new OracleParameter[] {
|
||||
new OracleParameter() { ParameterName = ":eid", OracleDbType = OracleDbType.Int64, Value = eid },
|
||||
new OracleParameter() { ParameterName = ":rightcode", OracleDbType = OracleDbType.Varchar2, Value = rightcode }
|
||||
};
|
||||
var specialrightList = await _repository.ExecuteSqlToListAsync<SpecialRihgtDto>(sql1, param1);
|
||||
if (!specialrightList.Any())//如果没有特殊权限直接返回空
|
||||
{
|
||||
return new List<decimal>();
|
||||
}
|
||||
var sql = "";
|
||||
var param = new List<OracleParameter>();
|
||||
if (specialrightList.FirstOrDefault(m => m.cid == 0) != null)//表明有查看全部的权限
|
||||
{
|
||||
sql = @"select
|
||||
a.businessid,
|
||||
b.businessname,
|
||||
b.channel
|
||||
from
|
||||
(
|
||||
select
|
||||
*
|
||||
from
|
||||
bas_businessdepartment
|
||||
) a
|
||||
join bas_businesslines b on a.businessid = b.businessid";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// 获取员工所属部门事业线ID
|
||||
var deptlist = specialrightList.Where(m => m.cid != 0).Select(m => m.cid);
|
||||
if (deptlist.Any())
|
||||
{
|
||||
string mmm = string.Join(',', deptlist);
|
||||
sql = $@"select
|
||||
a.businessid,
|
||||
b.businessname,
|
||||
b.channel
|
||||
from
|
||||
(
|
||||
select
|
||||
*
|
||||
from
|
||||
bas_businessdepartment
|
||||
where
|
||||
deptid in (
|
||||
select
|
||||
saledeptid
|
||||
from
|
||||
bas_salesdepartment start with saledeptid in(
|
||||
select v.saledeptid from bas_salesdepartment v where v.saledeptid in( {mmm} )
|
||||
or v.saledeptid in(
|
||||
select y.deptid from bas_innerusergroup y where y.gid in( {mmm} )
|
||||
)
|
||||
) connect by prior department_parentid = department_id
|
||||
)
|
||||
) a
|
||||
join bas_businesslines b on a.businessid = b.businessid";
|
||||
}
|
||||
}
|
||||
var business = await _repository.ExecuteSqlToListAsync<BusinessDto>(sql);
|
||||
if (business != null)
|
||||
businessIds = business.Select(m => m.Businessid ?? 0).Distinct().Where(x => x != 0).ToList();
|
||||
await _redisManager.SetAsync(key, businessIds, TimeSpan.FromMinutes(5));
|
||||
return businessIds;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "specialRightErro");
|
||||
}
|
||||
return businessIds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据销售组 或者部门获取eids
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<decimal>> GetEidsByDeptmentIds(GroupOrDeptIdDto dto)
|
||||
{
|
||||
List<decimal> res = new List<decimal>();
|
||||
if (string.IsNullOrWhiteSpace(dto.DeptId) && string.IsNullOrWhiteSpace(dto.GroupIds))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
var appid = GetApp();
|
||||
var key = $"{CacheKeys.EidInfo}_{appid}_{dto.DeptId}_{dto.GroupIds}";
|
||||
if (await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
return await _redisManager.GetListAsync<decimal>(key);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dto.GroupIds))
|
||||
{
|
||||
var groupIds = dto.GroupIds.Split(",").Select(n => Convert.ToDecimal(n)).ToList();
|
||||
var userGroup = await _repository.GetRepository<BAS_INNERUSERGROUP>().Query()
|
||||
.Include(x => x.BAS_INNERUSER).Where(n => n.GID.HasValue && groupIds.Contains(n.GID.Value)).ToListAsync();
|
||||
res = userGroup.Where(n => n.BAS_INNERUSER != null).Select(n => n.BAS_INNERUSER.EID).ToList();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(dto.DeptId))
|
||||
{
|
||||
List<decimal> ALLdeptIDS = new List<decimal>();
|
||||
List<decimal> ALLgidS = new List<decimal>();
|
||||
//向下遍历
|
||||
GetAllDeptIDOrGidByDeptStr(dto.DeptId, ref ALLdeptIDS, ref ALLgidS);
|
||||
var userGroup = await _repository.GetRepository<BAS_INNERUSERGROUP>().Query()
|
||||
.Include(x => x.BAS_INNERUSER).Where(u => ALLdeptIDS.Contains(u.DEPTID.Value) || (u.GID != null && ALLgidS.Contains(u.GID.Value))).ToListAsync();
|
||||
res = userGroup.Where(n => n.BAS_INNERUSER != null).Select(n => n.BAS_INNERUSER.EID).ToList();
|
||||
}
|
||||
res = res.Where(x => x != 0).Distinct().ToList();
|
||||
|
||||
await _redisManager.SetAsync(key, res, TimeSpan.FromMinutes(30));
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<BusinessLineInfo> GetBusinessLineByDeptMentIds(GroupOrDeptIdDto dto)
|
||||
{
|
||||
BusinessLineInfo res = new BusinessLineInfo();
|
||||
if (string.IsNullOrWhiteSpace(dto.DeptId) && string.IsNullOrWhiteSpace(dto.GroupIds))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
var appid = GetApp();
|
||||
var key = $"{CacheKeys.LineInfo}_{appid}_{dto.DeptId}_{dto.GroupIds}";
|
||||
if (await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
return await _redisManager.GetAsync<BusinessLineInfo>(key);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dto.GroupIds))
|
||||
{
|
||||
var groupIds = dto.GroupIds.Split(",").Select(n => Convert.ToDecimal(n)).ToList();
|
||||
var userGroup = await _repository.GetRepository<BAS_INNERUSERGROUP>().Query()
|
||||
.Include(x => x.BAS_INNERUSER).Where(n => n.GID.HasValue && groupIds.Contains(n.GID.Value)).ToListAsync();
|
||||
res.eidInfo = userGroup.Where(n => n.BAS_INNERUSER != null).Select(n => n.BAS_INNERUSER.EID).ToList();
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(dto.DeptId))
|
||||
{
|
||||
var deptids = dto.DeptId.Split(",").Select(n => Convert.ToDecimal(n)).ToList();
|
||||
var line = await _repository.GetRepository<BAS_BUSINESSDEPARTMENT>().FirstOrDefaultAsync(n => deptids.Contains(n.DEPTID));
|
||||
if (line != null)
|
||||
{
|
||||
res.isLine = true;
|
||||
res.deptId = line.BUSINESSID;
|
||||
}
|
||||
List<decimal> ALLdeptIDS = new List<decimal>();
|
||||
List<decimal> ALLgidS = new List<decimal>();
|
||||
//向下遍历
|
||||
GetAllDeptIDOrGidByDeptStr(dto.DeptId, ref ALLdeptIDS, ref ALLgidS);
|
||||
var userGroup = await _repository.GetRepository<BAS_INNERUSERGROUP>().Query()
|
||||
.Include(x => x.BAS_INNERUSER).Where(u => ALLdeptIDS.Contains(u.DEPTID.Value) || (u.GID != null && ALLgidS.Contains(u.GID.Value))).ToListAsync();
|
||||
res.eidInfo = userGroup.Where(n => n.BAS_INNERUSER != null).Select(n => n.BAS_INNERUSER.EID).ToList();
|
||||
}
|
||||
res.eidInfo = res.eidInfo.Where(x => x != 0).Distinct().ToList();
|
||||
|
||||
await _redisManager.SetAsync(key, res, TimeSpan.FromMinutes(30));
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<UserDeptNameInfo>> GetUserInfoByEIds(string eids)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(eids))
|
||||
{
|
||||
throw new ApiException("参数不能为空");
|
||||
}
|
||||
var eidList = eids.Split(",").ToList();
|
||||
var parameters = new List<OracleParameter>();
|
||||
var where = new List<string>();
|
||||
var i = 1;
|
||||
foreach (var eidStr in eidList)
|
||||
{
|
||||
if (int.TryParse(eidStr, out int eid))
|
||||
{
|
||||
parameters.Add(new OracleParameter($":eid{i}", OracleDbType.Int32) { Value = eid });
|
||||
where.Add($":eid{i}");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
var whereStr = string.Join(",", where);
|
||||
var sql = @$"select a.pkid,a.uname,a.eid,c.gid as GroupId,c.GNAME as GroupName,d.saledeptid as DeptId,d.DEPTNAME as DeptName
|
||||
from bas_inneruser a
|
||||
join bas_innerusergroup b on a.pkid = b.inneruserid
|
||||
left join bas_innergroup c on b.gid = c.gid
|
||||
left join bas_salesdepartment d on b.deptid = d.saledeptid
|
||||
where a.eid in ({whereStr}) or a.pkid in ({whereStr})";
|
||||
var res = await _repository.ExecuteSqlToListAsync<UserDeptNameInfo>(sql, parameters.ToArray());
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取上级部门id
|
||||
/// </summary>
|
||||
/// <param name="deptId"></param>
|
||||
/// <returns></returns>
|
||||
private List<decimal> GetParentDeptId(decimal? deptId)
|
||||
{
|
||||
List<decimal> res = new List<decimal> { };
|
||||
var salesDeptList = _repository.GetRepository<BAS_SALESDEPARTMENT>().Query().ToList();
|
||||
var dept = salesDeptList.FirstOrDefault(b => b.SALEDEPTID == deptId);
|
||||
BuildParentDept(dept, salesDeptList, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
private void BuildParentDept(BAS_SALESDEPARTMENT dept, List<BAS_SALESDEPARTMENT> deptList, List<decimal> res)
|
||||
{
|
||||
if (dept != null)
|
||||
{
|
||||
res.Add(dept.SALEDEPTID);
|
||||
if (dept.DEPARTMENT_PARENTID.HasValue)
|
||||
{
|
||||
var parDept = deptList.FirstOrDefault(n => n.DEPARTMENT_ID == dept.DEPARTMENT_PARENTID);
|
||||
BuildParentDept(parDept, deptList, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void GetAllDeptIDOrGidByDeptStr(string deptstr, ref List<decimal> ALLdeptIDS, ref List<decimal> ALLgidS)
|
||||
{
|
||||
var depts = deptstr.Split(',').Select(x => decimal.Parse(x)).ToList();
|
||||
foreach (var item in depts)
|
||||
{
|
||||
List<decimal> deptIDS = new List<decimal>();
|
||||
List<decimal> gidS = new List<decimal>();
|
||||
GetAllDeptIDOrGidByDeptId(item, ref deptIDS, ref gidS);//获取所有的组别和gid
|
||||
ALLdeptIDS.AddRange(deptIDS);
|
||||
ALLgidS.AddRange(gidS);
|
||||
}
|
||||
ALLdeptIDS = ALLdeptIDS.Distinct().ToList();
|
||||
ALLgidS = ALLgidS.Distinct().ToList();
|
||||
}
|
||||
|
||||
private void GetAllDeptIDOrGidByDeptId(decimal deptId, ref List<decimal> deptIDS, ref List<decimal> gidS)
|
||||
{
|
||||
var salesDeptList = _repository.GetRepository<BAS_SALESDEPARTMENT>().Query().ToList();
|
||||
var groupList = _repository.GetRepository<BAS_INNERGROUP>().Query().ToList();
|
||||
GetAllDeptIDOrGid(salesDeptList, groupList, deptId, ref deptIDS, ref gidS);//获取所有的子部门和销售组
|
||||
}
|
||||
|
||||
private void GetAllDeptIDOrGid(List<BAS_SALESDEPARTMENT> salesDeptList, List<BAS_INNERGROUP> groupList, decimal deptId, ref List<decimal> deptIDS, ref List<decimal> gidS)
|
||||
{
|
||||
var dept = salesDeptList.FirstOrDefault(m => m.SALEDEPTID == deptId);
|
||||
if (dept != null)
|
||||
{
|
||||
deptIDS.Add(deptId);//本ID也是需要加入
|
||||
List<BAS_SALESDEPARTMENT> list = salesDeptList.Where(n => n.DEPARTMENT_PARENTID == dept.DEPARTMENT_ID && n.IS_DELETED == 0 && n.SALEDEPTID != dept.SALEDEPTID).OrderBy(m => m.DEPARTMENT_SORT).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
deptIDS.Add(item.SALEDEPTID);
|
||||
GetAllDeptIDOrGid(salesDeptList, groupList, item.SALEDEPTID, ref deptIDS, ref gidS);
|
||||
}
|
||||
}
|
||||
gidS.AddRange(groupList.Where(m => m.SALEDEPTID == deptId).Select(m => m.GID));
|
||||
gidS.AddRange(groupList.Where(m => m.GID == deptId).Select(m => m.GID));
|
||||
}
|
||||
|
||||
public async Task<List<SalesDeptDto>> GetSalesDeptList()
|
||||
{
|
||||
var appid = GetApp();
|
||||
var key = $"{CacheKeys.SalesDeptList}_{appid}";
|
||||
if (!await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
var result = new List<SalesDeptDto>();
|
||||
var list = new List<SalesDeptDto>();
|
||||
// 切换事业部
|
||||
await SetApp(_repository, appid);
|
||||
var salesList = await _repository.GetRepository<BAS_SALESDEPARTMENT>().Query()
|
||||
.Include(x => x.BAS_INNERGROUP)
|
||||
.ToListAsync();
|
||||
foreach (var item in salesList)
|
||||
{
|
||||
var groups = item.BAS_INNERGROUP.Where(x => x.DEPARTMENT_ID != null).ToList();
|
||||
var sales = new SalesDeptDto
|
||||
{
|
||||
SalesGroupId = item.SALEDEPTID,
|
||||
Title = item.DEPTNAME,
|
||||
DepartmentParentId = item.DEPARTMENT_PARENTID,
|
||||
GroupIds = groups.Select(x => x.DEPARTMENT_ID.Value).ToList()
|
||||
};
|
||||
foreach (var group in groups)
|
||||
{
|
||||
var groupSales = new SalesDeptDto
|
||||
{
|
||||
SalesGroupId = group.GID,
|
||||
Title = group.GNAME,
|
||||
DepartmentParentId = null,
|
||||
GroupIds = new List<decimal> { group.DEPARTMENT_ID.Value }
|
||||
};
|
||||
list.Add(groupSales);
|
||||
}
|
||||
list.Add(sales);
|
||||
}
|
||||
foreach (var item in list)
|
||||
{
|
||||
GetSalesDepts(salesList, item, result);
|
||||
}
|
||||
foreach (var item in result)
|
||||
{
|
||||
if (list.Any(x => x.SalesGroupId == item.SalesGroupId))
|
||||
{
|
||||
var sales = list.First(x => x.SalesGroupId == item.SalesGroupId);
|
||||
sales.GroupIds.AddRange(item.GroupIds);
|
||||
sales.GroupIds = sales.GroupIds.Distinct().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(item);
|
||||
}
|
||||
}
|
||||
list = list.OrderBy(x => x.SalesGroupId).ToList();
|
||||
await _redisManager.SetAsync(key, list, TimeSpan.FromDays(1));
|
||||
return list;
|
||||
}
|
||||
return await _redisManager.GetListAsync<SalesDeptDto>(key);
|
||||
}
|
||||
|
||||
private void GetSalesDepts(List<BAS_SALESDEPARTMENT> salesList, SalesDeptDto item, List<SalesDeptDto> result)
|
||||
{
|
||||
if (item.DepartmentParentId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Log.Information($"test: result: {result.ToJson()}");
|
||||
foreach (var salesDept in salesList.Where(x => x.DEPARTMENT_ID == item.DepartmentParentId).ToList())
|
||||
{
|
||||
var sales = new SalesDeptDto();
|
||||
if (result.Any(x => x.SalesGroupId == salesDept.SALEDEPTID))
|
||||
{
|
||||
sales = result.First(x => x.SalesGroupId == salesDept.SALEDEPTID);
|
||||
sales.GroupIds.AddRange(item.GroupIds);
|
||||
sales.GroupIds = sales.GroupIds.Distinct().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
sales = new SalesDeptDto
|
||||
{
|
||||
SalesGroupId = salesDept.SALEDEPTID,
|
||||
Title = salesDept.DEPTNAME,
|
||||
DepartmentParentId = salesDept.DEPARTMENT_PARENTID
|
||||
};
|
||||
sales.GroupIds.AddRange(item.GroupIds);
|
||||
result.Add(sales);
|
||||
}
|
||||
if (sales.DepartmentParentId != null)
|
||||
{
|
||||
GetSalesDepts(salesList, sales, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<RoleLevel> LevelSSO(decimal eid)
|
||||
{
|
||||
var roleLevels = new List<UserRoleLevelDto>();
|
||||
var level = RoleLevel.Self;
|
||||
var appid = _appManager.GetApp();
|
||||
var key = $"{CacheKeys.UserRoleLevelList}_{appid}";
|
||||
if (!await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
return await RefreshLevelSSO(roleLevels, eid, appid);
|
||||
}
|
||||
roleLevels = await _redisManager.GetListAsync<UserRoleLevelDto>(key);
|
||||
if (roleLevels.Any(x => x.Eid == eid))
|
||||
{
|
||||
return roleLevels.Where(x => x.Eid == eid).Select(x => x.Level).FirstOrDefault();
|
||||
}
|
||||
return await RefreshLevelSSO(roleLevels, eid, appid);
|
||||
}
|
||||
|
||||
private async Task<RoleLevel> RefreshLevelSSO(List<UserRoleLevelDto> roleLevels, decimal eid, string appid)
|
||||
{
|
||||
var key = $"{CacheKeys.UserRoleLevelList}_{appid}";
|
||||
var level = RoleLevel.Self;
|
||||
var roleIds = await _repository.GetRepository<BAS_INNERUSERROLE>().Query()
|
||||
.Include(x => x.BAS_INNERUSER)
|
||||
.Where(x => x.BAS_INNERUSER.EID == eid)
|
||||
.Select(x => x.ROLEID)
|
||||
.ToListAsync();
|
||||
var codes = await _repository.GetRepository<BAS_ROLE>().Query()
|
||||
.Where(x => roleIds.Contains(x.ROLEID))
|
||||
.Select(x => x.CODE)
|
||||
.ToListAsync();
|
||||
var roleCodes = string.Join(",", codes);
|
||||
var groupIds = await _repository.GetRepository<BAS_GROUPLEADER>().Query()
|
||||
.Include(x => x.BAS_INNERUSER)
|
||||
.Where(x => x.BAS_INNERUSER.EID == eid)
|
||||
.Select(x => x.INNERGROUPID)
|
||||
.ToListAsync();
|
||||
if (codes.IndexOf("GLY") > -1 || codes.IndexOf("LOOKALL") > -1)//LOOKALL作为扩展权限
|
||||
{
|
||||
level = RoleLevel.All;
|
||||
}
|
||||
else if (groupIds != null && groupIds.Any())//管理了部门或者组
|
||||
{
|
||||
level = RoleLevel.Dept;
|
||||
if (groupIds.Contains(0))//如果有管理0,那么将进行显示全部
|
||||
{
|
||||
level = RoleLevel.All;
|
||||
}
|
||||
}
|
||||
roleLevels.Add(new UserRoleLevelDto
|
||||
{
|
||||
Eid = eid,
|
||||
Level = level
|
||||
});
|
||||
await _redisManager.SetAsync(key, roleLevels, TimeSpan.FromDays(1));
|
||||
return level;
|
||||
}
|
||||
|
||||
public async Task<List<decimal>> GetSalesDeptsForEid(decimal eid)
|
||||
{
|
||||
var groupIds = await _repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Include(x => x.BAS_GROUPLEADER)
|
||||
.Where(x => x.EID == eid)
|
||||
.Select(x => x.BAS_GROUPLEADER.Select(x => x.INNERGROUPID).ToList())
|
||||
.FirstOrDefaultAsync();
|
||||
var eids = await _repository.GetRepository<BAS_GROUPLEADER>().Query()
|
||||
.Include(x => x.BAS_INNERUSER)
|
||||
.Where(x => groupIds.Contains(x.INNERGROUPID))
|
||||
.Select(x => x.BAS_INNERUSER.EID)
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
return eids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取appid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ApiException"></exception>
|
||||
public string GetApp()
|
||||
{
|
||||
if (_httpContext.HttpContext == null) return _appManager.GetApp();
|
||||
_httpContext.HttpContext.Request.Headers.TryGetValue(AppHeaderAppoint.GetAppHeader(), out StringValues appValue);
|
||||
var app = appValue.ToString();
|
||||
if (string.IsNullOrEmpty(app))
|
||||
{
|
||||
app = _appManager.GetApp();
|
||||
if (string.IsNullOrEmpty(app))
|
||||
{
|
||||
throw new ApiException($"{AppHeaderAppoint.GetAppHeader()}不能为空!");
|
||||
}
|
||||
}
|
||||
return app;
|
||||
}
|
||||
|
||||
public async Task<List<DeptmentDto>> GetDeptments()
|
||||
{
|
||||
var key = $"{CacheKeys.ZxdParameterList}";
|
||||
if (!await _redisManager.ExistsAsync(key))
|
||||
{
|
||||
var response = await _httpClient.GetAsync<ApiResult<List<DeptmentDto>>>($"{_systemConfig.ZxdUrl}/Api/Deptment/Depts");
|
||||
if (response.Code == 0)
|
||||
{
|
||||
await _redisManager.SetAsync(key, response.Data, TimeSpan.FromDays(1));
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return await _redisManager.GetListAsync<DeptmentDto>(key);
|
||||
}
|
||||
return new List<DeptmentDto>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取员工领导Eid(销售组长、总监、业务负责人)
|
||||
/// </summary>
|
||||
/// <param name="deptid"></param>
|
||||
/// <param name="eid"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<decimal>> GetLeadEid(decimal deptid, decimal eid)
|
||||
{
|
||||
var result = new List<decimal> { eid };
|
||||
var user = await _repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Include(x => x.BAS_INNERUSERGROUP)
|
||||
.Where(x => x.EID == eid)
|
||||
.FirstOrDefaultAsync();
|
||||
if (user == null || user.BAS_INNERUSERGROUP == null) return result;
|
||||
var groupid = user.BAS_INNERUSERGROUP.GID;
|
||||
|
||||
var query = _repository.GetRepository<BAS_GROUPLEADER>().Query()
|
||||
.Include(x => x.BAS_INNERUSER)
|
||||
.Where(x => x.INNERGROUPID == groupid);
|
||||
var groups = await query.ToListAsync();
|
||||
var saleDeptids = new List<decimal?>();
|
||||
if (groups.Any())
|
||||
{
|
||||
result.AddRange(groups.Select(x => x.BAS_INNERUSER.EID).ToList());
|
||||
saleDeptids.AddRange(await _repository.GetRepository<BAS_INNERGROUP>().Query()
|
||||
.Where(x => groups.Select(y => y.INNERGROUPID).Contains(x.GID))
|
||||
.Select(x => x.SALEDEPTID)
|
||||
.ToListAsync());
|
||||
if (saleDeptids.Any() && saleDeptids.Any(x => x.HasValue))
|
||||
{
|
||||
query = _repository.GetRepository<BAS_GROUPLEADER>().Query()
|
||||
.Include(x => x.BAS_INNERUSER)
|
||||
.Where(x => x.TYPE == 1 && saleDeptids.Contains(x.INNERGROUPID) && x.LEADERTYPE.HasValue && new List<decimal> { 10, 40 }.Contains(x.LEADERTYPE.Value));
|
||||
var saleDepts = await query.ToListAsync();
|
||||
if (saleDepts.Any())
|
||||
{
|
||||
result.AddRange(saleDepts.Select(x => x.BAS_INNERUSER.EID).Distinct().ToList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo 添加部门负责人
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步数据
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SynchronousCustomer(SynchronousCustomerDto dto)
|
||||
{
|
||||
var Edd = _repository.GetRepository<EmployeeDepartmentDetail>().Query();
|
||||
//var Ed = _repository.GetRepository<EmployeeDepartment>().Query();
|
||||
|
||||
#region 处理 员工部门归属
|
||||
|
||||
var newIds = dto.eddList.Select(m => m.id);
|
||||
var oldEdd = Edd.Where(m => newIds.Contains(m.ID)).ToList();
|
||||
var newEddDto = dto.eddList.Where(m => !oldEdd.Select(m => m.ID).Contains(m.id));
|
||||
List<EmployeeDepartmentDetail> newEdd = new List<EmployeeDepartmentDetail>();
|
||||
foreach (var item in newEddDto)
|
||||
{
|
||||
EmployeeDepartmentDetail nedd = new EmployeeDepartmentDetail();
|
||||
nedd.ID = item.id;
|
||||
nedd.EID = item.eid;
|
||||
nedd.DEPARTMENT_ID = item.department_type;
|
||||
nedd.DEPARTMENT_ID = item.department_id;
|
||||
nedd.LEVEL = item.level;
|
||||
nedd.IS_DELETE = item.is_deleted;
|
||||
nedd.CREATE_TIME = item.create_time;
|
||||
nedd.UPDATE_TIME = item.update_time;
|
||||
newEdd.Add(nedd);
|
||||
}
|
||||
|
||||
#endregion 处理 员工部门归属
|
||||
|
||||
using var transaction = await _repository.BeginTransactionAsync();
|
||||
try
|
||||
{
|
||||
await _repository.GetRepository<EmployeeDepartmentDetail>().BatchUpdateAsync(oldEdd);
|
||||
await _repository.GetRepository<EmployeeDepartmentDetail>().BatchInsertAsync(newEdd);
|
||||
await transaction.CommitAsync();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "同步失败!");
|
||||
await transaction.RollbackAsync();
|
||||
await transaction.DisposeAsync();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<decimal> GetSeq_smallid_get(decimal deptid)
|
||||
{
|
||||
SetApp(_repository, deptid);
|
||||
OracleParameter[] p = { new OracleParameter("pkid", OracleDbType.Int64) };
|
||||
p[0].Direction = ParameterDirection.ReturnValue;
|
||||
await _repository.ExecuteSqlCommandAsync(CommandType.StoredProcedure, "PACK_BASE.Seq_smallid_get", p);
|
||||
return decimal.Parse(p[0].Value.ToString() ?? "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
internal static class CacheKeys
|
||||
{
|
||||
public const string SubComType = "sub_com_type_list";
|
||||
|
||||
public const string LabelName = "label_name_list";
|
||||
|
||||
public const string ZxdParameterList = "zxd_parameter_list";
|
||||
|
||||
public const string ParameterList = "parameter_list";
|
||||
|
||||
public const string SalesDeptList = "sales_dept_list";
|
||||
|
||||
public const string UserRoleLevelList = "role_level_list";
|
||||
|
||||
public const string UserListKey = "online_user_list";
|
||||
|
||||
public const string MssagesKey = "order_user_protection_mssages";
|
||||
|
||||
public const string StatisticsKey = "order_user_protection_statistics";
|
||||
|
||||
public const string UserInfo = "user_info";
|
||||
public const string EidInfo = "eid_info";
|
||||
public const string LineInfo = "businessLine_info";
|
||||
public const string EidDeptNameInfo = "eid_deptName_info";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
public class Consumer
|
||||
{
|
||||
public string? Host { get; set; }
|
||||
|
||||
public string? GroupId { get; set; }
|
||||
|
||||
public string? Topic { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
public enum ParameterEnums
|
||||
{
|
||||
ISVR_Saleclus_Get,
|
||||
CRM_CORE_NOTIFICATION_ENABLED,
|
||||
CRM_CORE_NOTIFICATION_EXCLUDE,
|
||||
CRM_CORE_FORCED_DOWNLINE_ENABLED,
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
public class SystemConfig
|
||||
{
|
||||
public SystemConfig()
|
||||
{
|
||||
}
|
||||
|
||||
public List<App> Apps { get; set; }
|
||||
|
||||
public string SsoUrl { get; set; }
|
||||
|
||||
public string SsoOrganizationUrl { get; set; }
|
||||
|
||||
public string SsoTokenUrl { get; set; }
|
||||
|
||||
public string ZxdUrl { get; set; }
|
||||
|
||||
public string LiveUrl { get; set; }
|
||||
public string BdMarkting { get; set; }
|
||||
|
||||
public string LiveRealtimeUrl { get; set; }
|
||||
|
||||
public string LiveSummaryUrl { get; set; }
|
||||
|
||||
public string LiveWeworkUsersUrl { get; set; }
|
||||
|
||||
public string LiveUserStatUrl { get; set; }
|
||||
|
||||
public string LiveWeworkStatUrl { get; set; }
|
||||
|
||||
public string LiveCourseSummaryUrl { get; set; }
|
||||
|
||||
public string WeworkSendUrl { get; set; }
|
||||
|
||||
public string SalesLeadUrl { get; set; }
|
||||
|
||||
public string CmsUrl { get; set; }
|
||||
public string CmsInternetUrl { get; set; }
|
||||
|
||||
public string CourseUrl { get; set; }
|
||||
public string ProductsUrl { get; set; }
|
||||
|
||||
public string DeptMentUrl { get; set; }
|
||||
|
||||
public string BusinessLineUrl { get; set; }
|
||||
|
||||
public string CustomerProtectionsUrl { get; set; }
|
||||
public string CustomerProtectionDepts { get; set; }
|
||||
|
||||
public string CRMClientKey { get; set; }
|
||||
|
||||
public string LivePlaybackDetailUrl { get; set; }
|
||||
|
||||
public string LivePlaybackSummaryUrl { get; set; }
|
||||
|
||||
public string ZxdCrmUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户端密钥
|
||||
/// </summary>
|
||||
public List<ClientKey>? ClientKey { get; set; }
|
||||
|
||||
public string GetAccessKey(string id)
|
||||
{
|
||||
return ClientKey?.First(x => x.Id == id).AccessKey ?? "";
|
||||
}
|
||||
|
||||
public string GetSsoOrganizationUrl()
|
||||
{
|
||||
return $"{SsoUrl}{SsoOrganizationUrl}";
|
||||
}
|
||||
|
||||
public string GetSsoTokenUrl()
|
||||
{
|
||||
return $"{SsoUrl}{SsoTokenUrl}";
|
||||
}
|
||||
|
||||
public string GetCourseUrl()
|
||||
{
|
||||
return $"{CmsInternetUrl}{CourseUrl}";
|
||||
}
|
||||
|
||||
public string GetDeptMentUrl()
|
||||
{
|
||||
return $"{CmsUrl}{DeptMentUrl}";
|
||||
}
|
||||
|
||||
public string GetBusinessLineUrl()
|
||||
{
|
||||
return $"{CmsUrl}{BusinessLineUrl}";
|
||||
}
|
||||
public string GetProductsUrl()
|
||||
{
|
||||
return "http://bd-markting.soft.dn8188.com/live/course/products";
|
||||
//return $"{LiveUrl}{ProductsUrl}";
|
||||
}
|
||||
public string GetLiveRealtimeUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveRealtimeUrl}";
|
||||
}
|
||||
|
||||
public string GetLiveSummaryUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveSummaryUrl}";
|
||||
}
|
||||
|
||||
public string GetLiveWeworkUsersUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveWeworkUsersUrl}";
|
||||
}
|
||||
public string GetLiveCourseProductsUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveWeworkUsersUrl}";
|
||||
}
|
||||
public string GetLiveUserStatUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveUserStatUrl}";
|
||||
}
|
||||
|
||||
public string GetLiveWeworkStatUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveWeworkStatUrl}";
|
||||
}
|
||||
|
||||
public string GetLiveCourseSummaryUrl()
|
||||
{
|
||||
return $"{LiveUrl}{LiveCourseSummaryUrl}";
|
||||
}
|
||||
|
||||
public string GetCustomerProtectionsUrl()
|
||||
{
|
||||
return $"{LiveUrl}{CustomerProtectionsUrl}";
|
||||
}
|
||||
|
||||
public string GetCustomerProtectionDepts()
|
||||
{
|
||||
return $"{LiveUrl}{CustomerProtectionDepts}";
|
||||
}
|
||||
|
||||
public string GetLivePlaybackDetailUrl()
|
||||
{
|
||||
return $"{BdMarkting}{LivePlaybackDetailUrl}";
|
||||
}
|
||||
|
||||
public string GetLivePlaybackSummaryUrl()
|
||||
{
|
||||
return $"{BdMarkting}{LivePlaybackSummaryUrl}";
|
||||
}
|
||||
|
||||
public string GetDeptNameByEid(string eidList)
|
||||
{
|
||||
return $"{ZxdCrmUrl}/Api/SSO/GetDeptNameByEid?eidList={eidList}";
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientKey
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string AccessKey { get; set; }
|
||||
}
|
||||
|
||||
public class App
|
||||
{
|
||||
public List<decimal>? Deptids { get; set; }
|
||||
|
||||
public string? AppName { get; set; }
|
||||
|
||||
public string? Appid { get; set; }
|
||||
|
||||
public string? AppSecret { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
public class SystemEnums
|
||||
{
|
||||
public enum RoleLevel
|
||||
{
|
||||
Self,
|
||||
All,
|
||||
Dept,
|
||||
Privilege,
|
||||
Company,
|
||||
Group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Config
|
||||
{
|
||||
public class WeworkConfig
|
||||
{
|
||||
public List<WhiteItem>? WhiteList { get; set; }
|
||||
|
||||
public bool IsWhite(string? userId, string? corpId)
|
||||
{
|
||||
if (WhiteList == null || !WhiteList.Any()) return true;
|
||||
if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(corpId)) return false;
|
||||
return WhiteList.Any(x => x.UserId.Equals(userId) && x.CorpId.Equals(corpId));
|
||||
}
|
||||
}
|
||||
|
||||
public class WhiteItem
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string CorpId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Dto\MSGTool\**" />
|
||||
<EmbeddedResource Remove="Dto\MSGTool\**" />
|
||||
<None Remove="Dto\MSGTool\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Confluent.Kafka" Version="1.9.2" />
|
||||
<PackageReference Include="DG.Core" Version="1.0.24" />
|
||||
<PackageReference Include="DG.Redis" Version="1.0.5" />
|
||||
<PackageReference Include="DG.Tool" Version="1.0.9" />
|
||||
<PackageReference Include="Exceptionless.AspNetCore" Version="6.0.1" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Exceptionless" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Zxd.Core.Shared" Version="1.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Crm.Core.EntityFramework\Crm.Core.EntityFramework.csproj" />
|
||||
<ProjectReference Include="..\Crm.Core.Shared\Crm.Core.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="DG.EntityFramework" />
|
||||
<Using Include="DG.Core" />
|
||||
<Using Include="DG.Tool" />
|
||||
<Using Include="DG.Redis" />
|
||||
<Using Include="Serilog" />
|
||||
<Using Include="Crm.Core.Entity" />
|
||||
<Using Include="Crm.Core.Entity.Crm" />
|
||||
<Using Include="Crm.Core.Entity.Wework" />
|
||||
<Using Include="Microsoft.Extensions.Configuration" />
|
||||
<Using Include="Microsoft.AspNetCore.SignalR" />
|
||||
<Using Include="System.ComponentModel.DataAnnotations" />
|
||||
<Using Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<Using Include="Microsoft.AspNetCore.Http" />
|
||||
<Using Include="System.Text.Json" />
|
||||
<Using Include="System.Text.Json.Serialization" />
|
||||
<Using Include="Crm.Core.Domain.Dto" />
|
||||
<Using Include="Crm.Core.Domain.Dto.Wework" />
|
||||
<Using Include="Crm.Core.Domain.Dto.CRM" />
|
||||
<Using Include="Crm.Core.Domain.Config" />
|
||||
<Using Include="Crm.Core.Domain.Impl" />
|
||||
<Using Include="Crm.Core.Domain.Response" />
|
||||
<Using Include="Crm.Core.Domain.Dto.Live" />
|
||||
<Using Include="Crm.Core.Domain.Dto.LivePlayback" />
|
||||
<Using Include="Crm.Core.EntityFramework" />
|
||||
<Using Include="Microsoft.EntityFrameworkCore" />
|
||||
<Using Include="Crm.Core.Domain.Hubs" />
|
||||
<Using Include="Zxd.Core.Shared.Dto" />
|
||||
<Using Include="Crm.Core.Shared.Dto" />
|
||||
<Using Include="Crm.Core.Shared" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
using Crm.Core.Domain.Dto.CRM;
|
||||
using Crm.Core.Domain.Dto.Customer;
|
||||
using Crm.Core.Domain.Impl;
|
||||
using Crm.Core.Entity.Crm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
public class CustomerDomain : ICustomerDomain
|
||||
{
|
||||
private readonly ICacheDomain _cacheDomain;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IOracleRepository<CrmDbContext> _repository;
|
||||
|
||||
public CustomerDomain(ICacheDomain cacheDomain,
|
||||
IHttpClient httpClient,
|
||||
IConfiguration configuration,
|
||||
IOracleRepository<CrmDbContext> repository)
|
||||
{
|
||||
_cacheDomain = cacheDomain;
|
||||
_httpClient = httpClient;
|
||||
_configuration = configuration;
|
||||
_repository = repository;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取销售线索列表
|
||||
/// </summary>
|
||||
/// <param name="resId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SalesLeadDto>> GetSalesLeadList(string encyptDto)
|
||||
{
|
||||
var systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
var url = systemConfig.SalesLeadUrl;
|
||||
var t = SecurityHelper.DecyptData(encyptDto, "dwj5rc8x");
|
||||
saledsleadDesDto param = JsonHelper.FromJson<saledsleadDesDto>(t);
|
||||
var resId = param.resid;
|
||||
var content = "";
|
||||
var jsonDto = "";
|
||||
if (resId == null || resId == "")
|
||||
{
|
||||
jsonDto = JsonHelper.ToJson(new saledsleadDesDto { appid = param.appid, appuserid = param.appuserid, deptid = param.deptid, eid = param.eid, ext_flag = param.ext_flag });
|
||||
content = HttpUtility.UrlEncode(SecurityHelper.EncyptData(jsonDto, "dwj5rc8x"));
|
||||
return new List<SalesLeadDto> { new SalesLeadDto { Name="默认",Url = $"{url}?content={content}&clientid=WK_EXT" } };
|
||||
}
|
||||
var result = new List<SalesLeadDto>();
|
||||
var key = systemConfig.GetAccessKey(systemConfig.CRMClientKey);
|
||||
var userlist = await _repository.GetRepository<WW_EXTUSER_RESID>().QueryIncluding(x => x.WW_EXTUSER)
|
||||
.Where(x => x.RESID == resId).ToListAsync();
|
||||
foreach (var user in userlist)
|
||||
{
|
||||
if (user.WW_EXTUSER == null) continue;
|
||||
var exinfo = JsonHelper.FromJson<ExternalUserDto>(user.WW_EXTUSER.EXINFO);
|
||||
if (exinfo.External_contact == null) continue;
|
||||
var contact = exinfo.External_contact;
|
||||
var appid = user.WW_EXTUSER.CORPID != "com.dongniu" ? user.WW_EXTUSER.CORPID : user.WW_EXTUSER.CORPID;
|
||||
jsonDto = "";
|
||||
content = "";
|
||||
jsonDto = JsonHelper.ToJson(new saledsleadDesDto { appid = appid, appuserid = contact.ExternalUserId, deptid = param.deptid, eid = param.eid, ext_flag = param.ext_flag });
|
||||
content = HttpUtility.UrlEncode(SecurityHelper.EncyptData(jsonDto, "dwj5rc8x"));
|
||||
result.Add(new SalesLeadDto
|
||||
{
|
||||
Name = contact.Name,
|
||||
Appid = appid,
|
||||
Appuserid = contact.ExternalUserId,
|
||||
Url = $"{url}?content={content}&clientid=WK_EXT"
|
||||
});
|
||||
}
|
||||
|
||||
var customerId = await _repository.GetRepository<RES_CUSTOMER>().Query()
|
||||
.Where(x => x.RESID == resId).Select(x => x.RESID).FirstOrDefaultAsync();
|
||||
var resIds = await _repository.GetRepository<RES_CUSTOMER>().Query()
|
||||
.Where(x => x.CUSTOMERID == customerId).Select(x => x.RESID).ToListAsync();
|
||||
var customerUserList = await _repository.GetRepository<RES_CUSTOMERUSER>().Query()
|
||||
.Where(x => resIds.Contains(x.RESID)).ToListAsync();
|
||||
|
||||
foreach (var customerUser in customerUserList)
|
||||
{
|
||||
var name = PhoneHelper.FormatPhoneUserName(customerUser.USERNAME);
|
||||
jsonDto = "";
|
||||
content = "";
|
||||
jsonDto = JsonHelper.ToJson(new saledsleadDesDto { appid = "com.dongniu", appuserid = name, deptid = param.deptid, eid = param.eid, ext_flag = param.ext_flag });
|
||||
content = HttpUtility.UrlEncode(SecurityHelper.EncyptData(jsonDto, "dwj5rc8x"));
|
||||
result.Add(new SalesLeadDto
|
||||
{
|
||||
Name = name,
|
||||
Url = $"{url}?content={content}&clientid=WK_EXT"
|
||||
});
|
||||
}
|
||||
|
||||
var parameter = await _cacheDomain.GetValueParameter("ISVR_Saleclus_Get");
|
||||
if (string.IsNullOrEmpty(parameter)) return result;
|
||||
var mobiles = await _repository.GetRepository<RES_RESOURCEMOBILE>().Query()
|
||||
.Where(x => x.RESID == resId).Select(x => SecurityHelper.DecyptData(x.MOBILE, key)).ToListAsync();
|
||||
if (mobiles == null || !mobiles.Any())
|
||||
{
|
||||
throw new ApiException("暂无销售线索!", -1);
|
||||
}
|
||||
var response = await _httpClient.PostAsync<SaleClusResult<SaleRelation>>(parameter, new { mobiles });
|
||||
if (response.Ret != 0 || response.List == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
foreach (var saleRelation in response.List)
|
||||
{
|
||||
if (result.Any(x => x.Appuserid == saleRelation.Appuserid && x.Appid == saleRelation.Appid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var name = saleRelation.Appuserid.Length > 10 ?
|
||||
saleRelation.Appuserid[..10] + "*****" :
|
||||
saleRelation.Appuserid;
|
||||
jsonDto = "";
|
||||
content = "";
|
||||
jsonDto = JsonHelper.ToJson(new saledsleadDesDto { appid = saleRelation.Appid, appuserid = saleRelation.Appuserid, deptid = param.deptid, eid = param.eid, ext_flag = param.ext_flag });
|
||||
content = HttpUtility.UrlEncode(SecurityHelper.EncyptData(jsonDto, "dwj5rc8x"));
|
||||
|
||||
result.Add(new SalesLeadDto
|
||||
{
|
||||
Name = name,
|
||||
Url = $"{url}?content={content}&clientid=WK_EXT"
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public async Task<bool> BestCustomerCreate(BestCustomerDto model)
|
||||
{
|
||||
var result = true;
|
||||
//resid为空 则根据 外部联系人id查找resid
|
||||
if (string.IsNullOrWhiteSpace(model.ResId))
|
||||
{
|
||||
var userlist = await _repository.GetRepository<WW_EXTUSER_RESID>().Query().Where(x => x.USERID == model.OutUserId).ToListAsync();
|
||||
model.ResId = string.Join(",", userlist.Select(n=>n.RESID));
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(model.ResId))
|
||||
{
|
||||
throw new Exception("该客户未关联客户id !");
|
||||
}
|
||||
try
|
||||
{
|
||||
var resids = model.ResId.Split(",").Distinct().ToList();
|
||||
BAS_INNERUSER user = new BAS_INNERUSER();
|
||||
if (model.Eid.HasValue)
|
||||
{
|
||||
user = await _repository.GetRepository<BAS_INNERUSER>().FirstOrDefaultAsync(n => n.EID == model.Eid);
|
||||
}
|
||||
var bestRepository = _repository.GetRepository<RES_CUSTOMER_BEST>();
|
||||
var dbBestList = bestRepository.Query().Where(n => resids.Contains(n.RESID)).ToList();
|
||||
foreach (var item in resids)
|
||||
{
|
||||
var dbModel = dbBestList.FirstOrDefault(n => n.RESID == item);
|
||||
if (dbModel == null)
|
||||
{
|
||||
RES_CUSTOMER_BEST newModel = new RES_CUSTOMER_BEST
|
||||
{
|
||||
RESID = item,
|
||||
REMARK = model.Remark,
|
||||
CTIME = DateTime.Now,
|
||||
CORPID = model.CropId,
|
||||
OUTUSERID = model.OutUserId,
|
||||
USERID = model.UserId,
|
||||
CREATEID = user?.PKID,
|
||||
CUSERNAME = user?.UNAME
|
||||
};
|
||||
await bestRepository.InsertAsync(newModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dbModel.CREATEID != user?.PKID)
|
||||
{
|
||||
throw new Exception($"该客户已被标记 !");
|
||||
}
|
||||
dbModel.UTIME = DateTime.Now;
|
||||
dbModel.REMARK = model.Remark;
|
||||
dbModel.CREATEID = user?.PKID;
|
||||
dbModel.CUSERNAME = user?.UNAME;
|
||||
await bestRepository.UpdateAsync(dbModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Log.Error($"插入优质客户失败{ex.Message}");
|
||||
throw new Exception($"{ex.Message}");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<WwHhuserEidDto>> GetWwHhuserEids(List<decimal> eids, int deptid)
|
||||
{
|
||||
if (await _cacheDomain.SetApp(_repository, deptid))
|
||||
{
|
||||
var data = await _repository.GetRepository<WW_HHUSER_EID>().Query()
|
||||
.Where(x => eids.Contains(x.EID.Value))
|
||||
.Select(x => new WwHhuserEidDto
|
||||
{
|
||||
CORPID = x.CORPID,
|
||||
EID = x.EID,
|
||||
USERID = x.USERID,
|
||||
}).ToListAsync();
|
||||
return data;
|
||||
}
|
||||
return new List<WwHhuserEidDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class BusinessDto
|
||||
{
|
||||
public decimal? Businessid { get; set; }
|
||||
|
||||
public string? BusinessName { get; set; }
|
||||
|
||||
public decimal? Channel { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class CrmUserDto
|
||||
{
|
||||
public string? Username { get; set; }
|
||||
|
||||
public decimal? Eid { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class ExternalUserDto
|
||||
{
|
||||
public ExternalUserDto(ExternalContactDto external_contact, List<FollowUserDto> followUsers, string corpId)
|
||||
{
|
||||
External_contact = external_contact;
|
||||
FollowUsers = followUsers;
|
||||
CorpId = corpId;
|
||||
}
|
||||
|
||||
[JsonPropertyName("External_contact")]
|
||||
public ExternalContactDto External_contact { get; set; }
|
||||
|
||||
[JsonPropertyName("Follow_user")]
|
||||
public List<FollowUserDto> FollowUsers { get; set; }
|
||||
|
||||
[JsonPropertyName("Corpid")]
|
||||
public string CorpId { get; set; }
|
||||
}
|
||||
|
||||
public class ExternalContactDto
|
||||
{
|
||||
[JsonPropertyName("External_userid")]
|
||||
public string? ExternalUserId { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
public class FollowUserDto
|
||||
{
|
||||
public string? Saleeid { get; set; }
|
||||
public string? Userid { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public long Createtime { get; set; }
|
||||
public string? Bindtime { get; set; }
|
||||
|
||||
[JsonPropertyName("Remark_mobiles")]
|
||||
public List<string>? RemarkMobiles { get; set; }
|
||||
|
||||
public string? Uname { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class NotificationDto
|
||||
{
|
||||
public decimal Id { get; set; }
|
||||
|
||||
public string? NotificationId { get; set; }
|
||||
|
||||
public string? NotificationValue { get; set; }
|
||||
|
||||
public decimal? Eid { get; set; }
|
||||
|
||||
public decimal? Read { get; set; }
|
||||
|
||||
public string? ReadStr { get { return Read == 0 ? "未读" : "已读"; } }
|
||||
|
||||
public string? Message { get; set; }
|
||||
|
||||
public DateTime? Ctime { get; set; }
|
||||
|
||||
public DateTime? ReadTime { get; set; }
|
||||
|
||||
public NotificationType? NotificationType { get; set; }
|
||||
|
||||
public string? NotificationTypeStr { get { return NotificationType?.GetDescription(); } }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class NotificationSearchPageDto : SearchPageBase
|
||||
{
|
||||
public int Eid { get; set; }
|
||||
|
||||
public int? Read { get; set; }
|
||||
|
||||
public DateTime? TimeFrom { get; set; }
|
||||
|
||||
public DateTime? TimeTo { get; set; }
|
||||
|
||||
public NotificationType? NotificationType { get; set; }
|
||||
|
||||
public int? ComplaintType { get; set; }
|
||||
public int? ComplaintReason { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class NotificationStatisticsDto
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
[JsonPropertyName("end_time")]
|
||||
public string? EndTime { get; set; }
|
||||
|
||||
[JsonPropertyName("deptid")]
|
||||
public decimal? DeptId { get; set; }
|
||||
|
||||
[JsonPropertyName("deptname")]
|
||||
public string? DeptName { get; set; }
|
||||
|
||||
[JsonPropertyName("eid")]
|
||||
public decimal? Eid { get; set; }
|
||||
|
||||
[JsonPropertyName("ename")]
|
||||
public string? Ename { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_type")]
|
||||
public int? RepeatType { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_type_str")]
|
||||
public string? RepeatTypeStr { get; set; }
|
||||
|
||||
[JsonPropertyName("cross_dept")]
|
||||
public int? CrossDept { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_deptid")]
|
||||
public decimal? RepeatDeptId { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_deptname")]
|
||||
public string? RepeatDeptName { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_eid")]
|
||||
public decimal? RepeatEid { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_userid")]
|
||||
public string? RepeatUserId { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_ename")]
|
||||
public string? RepeatEname { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_start_time")]
|
||||
public string? RepeatStartTime { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_end_time")]
|
||||
public string? RepeatEndTime { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_days")]
|
||||
public int? RepeatDays { get; set; }
|
||||
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CTIME { get; set; }
|
||||
|
||||
[JsonPropertyName("update_time")]
|
||||
public string? UTIME { get; set; }
|
||||
|
||||
[JsonPropertyName("groupid")]
|
||||
public int? GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class NotificationStatisticsSearchPageDto : ListSearchPageDto
|
||||
{
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonPropertyName("resid")]
|
||||
public string? ResId { get; set; }
|
||||
|
||||
[JsonPropertyName("Umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
[JsonPropertyName("eid")]
|
||||
public decimal? Eid { get; set; }
|
||||
|
||||
[JsonPropertyName("ename")]
|
||||
public string? Ename { get; set; }
|
||||
|
||||
[JsonPropertyName("end_time_from")]
|
||||
public string? StartTime { get; set; }
|
||||
|
||||
[JsonPropertyName("end_time_to")]
|
||||
public string? EndTime { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_ename")]
|
||||
public string? RepeatEname { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_eid")]
|
||||
public decimal? RepeatEid { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_start_time_from")]
|
||||
public string? RepeatStartTime { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_start_time_to")]
|
||||
public string? RepeatEndTime { get; set; }
|
||||
|
||||
[JsonPropertyName("deptid")]
|
||||
public decimal? DeptId { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_type")]
|
||||
public int? RepeatType { get; set; }
|
||||
|
||||
[JsonPropertyName("cross_dept")]
|
||||
public int? CrossDept { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_deptid")]
|
||||
public decimal? RepeatDeptId { get; set; }
|
||||
|
||||
[JsonPropertyName("deptids")]
|
||||
public string? Deptids { get; set; }
|
||||
|
||||
[JsonPropertyName("repeat_deptids")]
|
||||
public string? RepeatDeptids { get; set; }
|
||||
|
||||
[JsonPropertyName("exclude_repeat_eids")]
|
||||
public string? ExcludeRepeatEids { get; set; }
|
||||
|
||||
[JsonPropertyName("show_deptids")]
|
||||
public string? ShowDeptids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public decimal? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("show_eid")]
|
||||
public decimal? ShowEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("show_groupids")]
|
||||
public string? ShowGroupIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售组id
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
//[JsonPropertyName("txt_groupIds")]
|
||||
public decimal? Txt_groupIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售部门id
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
//[JsonPropertyName("txt_deptId")]
|
||||
public decimal? Txt_deptId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class OnlineUserInfoDto
|
||||
{
|
||||
public decimal Eid { get; set; }
|
||||
|
||||
public long UserId { get; set; }
|
||||
|
||||
public string? Appid { get; set; }
|
||||
|
||||
public string? UserName { get; set; }
|
||||
|
||||
public string? ConnectionId { get; set; }
|
||||
|
||||
public DateTime? LoginTime { get; set; }
|
||||
|
||||
public string? Ip { get; set; }
|
||||
|
||||
public bool Freelogin { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
using Confluent.Kafka;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class OrderUserProtectionDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键ID
|
||||
/// </summary>
|
||||
public string? id { get; set; }
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
public string? resid { get; set; }
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
public string? umid { get; set; }
|
||||
/// <summary>
|
||||
/// 客户姓名
|
||||
/// </summary>
|
||||
public string? name { get; set; }
|
||||
/// <summary>
|
||||
/// 客户手机号码
|
||||
/// </summary>
|
||||
public string? mobile { get; set; }
|
||||
/// <summary>
|
||||
/// 客户微信ID
|
||||
/// </summary>
|
||||
public string? extuerid { get; set; }
|
||||
/// <summary>
|
||||
/// 成交订单ID
|
||||
/// </summary>
|
||||
public string? szzyorderid { get; set; }
|
||||
/// <summary>
|
||||
/// 保护期截至日期
|
||||
/// </summary>
|
||||
public long? end_time { get; set; }
|
||||
/// <summary>
|
||||
/// 保护期截至日期
|
||||
/// </summary>
|
||||
public string? EndTimeStr { get
|
||||
{
|
||||
if (!end_time.HasValue) return "";
|
||||
long begtime = end_time.Value * 10000;
|
||||
DateTime dt_1970 = new DateTime(1970, 1, 1, 8, 0, 0);
|
||||
long tricks_1970 = dt_1970.Ticks;//1970年1月1日刻度
|
||||
long time_tricks = tricks_1970 + begtime;//日志日期刻度
|
||||
DateTime dateTime = new DateTime(time_tricks);//转化为DateTime
|
||||
//var dateTime = DateTime.FromBinary(end_time.Value); // 转换为DateTime类型
|
||||
return dateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 成交部门ID
|
||||
/// </summary>
|
||||
public decimal deptid { get; set; }
|
||||
/// <summary>
|
||||
/// 成交部门名称
|
||||
/// </summary>
|
||||
public string? deptname { get; set; }
|
||||
/// <summary>
|
||||
/// 成交员工ID
|
||||
/// </summary>
|
||||
public int? eid { get; set; }
|
||||
/// <summary>
|
||||
/// 成交员工名称
|
||||
/// </summary>
|
||||
public string? ename { get; set; }
|
||||
/// <summary>
|
||||
/// 重复联系类型
|
||||
/// 1:企微联系,2:电话联系,3:企微和电话联系
|
||||
/// </summary>
|
||||
public int repeat_type { get; set; }
|
||||
/// <summary>
|
||||
/// 是否跨事业部重复
|
||||
/// 0:否,1:是
|
||||
/// </summary>
|
||||
public int cross_dept { get; set; }
|
||||
/// <summary>
|
||||
/// 重复联系事业部ID
|
||||
/// </summary>
|
||||
public int? repeat_deptid { get; set; }
|
||||
/// <summary>
|
||||
/// 重复联系事业名称
|
||||
/// </summary>
|
||||
public string? repeat_deptname { get; set; }
|
||||
/// <summary>
|
||||
/// 重复客服ID
|
||||
/// </summary>
|
||||
public int? repeat_eid { get; set; }
|
||||
/// <summary>
|
||||
/// 重复客服微信ID
|
||||
/// </summary>
|
||||
public string? repeat_userid { get; set; }
|
||||
/// <summary>
|
||||
/// 重复客服名称
|
||||
/// </summary>
|
||||
public string? repeat_ename { get; set; }
|
||||
/// <summary>
|
||||
/// 重复客服应用ID
|
||||
/// </summary>
|
||||
public string? repeat_appid { get; set; }
|
||||
/// <summary>
|
||||
/// 开始重复联系日期
|
||||
/// </summary>
|
||||
public double? repeat_start_time { get; set; }
|
||||
/// <summary>
|
||||
/// 最后重复联系日期
|
||||
/// </summary>
|
||||
public double? repeat_end_time { get; set; }
|
||||
/// <summary>
|
||||
/// 累计重复联系天数
|
||||
/// </summary>
|
||||
public int repeat_days { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public double? create_time { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
public double? update_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 渠道
|
||||
/// </summary>
|
||||
public long channel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string? nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客服appid
|
||||
/// </summary>
|
||||
public string? appid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客服userid
|
||||
/// </summary>
|
||||
public string? repeat_appuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限到期时间
|
||||
/// </summary>
|
||||
public long? orderpasstime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限到期时间
|
||||
/// </summary>
|
||||
public string? OrderPassTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!orderpasstime.HasValue) return "";
|
||||
long begtime = orderpasstime.Value * 10000;
|
||||
DateTime dt_1970 = new DateTime(1970, 1, 1, 8, 0, 0);
|
||||
long tricks_1970 = dt_1970.Ticks;//1970年1月1日刻度
|
||||
long time_tricks = tricks_1970 + begtime;//日志日期刻度
|
||||
DateTime dateTime = new DateTime(time_tricks);//转化为DateTime
|
||||
//var dateTime = DateTime.FromBinary(orderpasstime.Value); // 转换为DateTime类型
|
||||
return dateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class RepeatDeptmentDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 成交部门
|
||||
/// </summary>
|
||||
public List<RepeatDeptments> DealDepts { get; set; } = new List<RepeatDeptments>();
|
||||
/// <summary>
|
||||
/// 重复部门
|
||||
/// </summary>
|
||||
public List<RepeatDeptments> RepeatDepts { get; set; } = new List<RepeatDeptments>();
|
||||
}
|
||||
|
||||
public class RepeatDeptments
|
||||
{
|
||||
public int? deptid { get; set; }
|
||||
public string deptname { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class SalesDeptDto
|
||||
{
|
||||
public SalesDeptDto()
|
||||
{
|
||||
GroupIds = new List<decimal>();
|
||||
}
|
||||
|
||||
public decimal? SalesGroupId { get; set; }
|
||||
|
||||
public string? Title { get; set; }
|
||||
|
||||
public decimal? DepartmentParentId { get; set; }
|
||||
|
||||
public List<decimal> GroupIds { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class SalesLeadDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接
|
||||
/// </summary>
|
||||
public string? Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string? Appid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string? Appuserid { get; set; }
|
||||
}
|
||||
public class saledsleadDesDto
|
||||
{
|
||||
public string appid { get; set; }
|
||||
public string appuserid { get; set; }
|
||||
public string deptid { get; set; }
|
||||
public string eid { get; set; }
|
||||
public string resid { get; set; }
|
||||
public long ext_flag { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class SendMessageDto
|
||||
{
|
||||
public SendMessageDto()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
public decimal? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事业部id
|
||||
/// </summary>
|
||||
public decimal? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工id
|
||||
/// </summary>
|
||||
public decimal Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
public string? Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 资源id
|
||||
/// </summary>
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 渠道号
|
||||
/// </summary>
|
||||
public decimal? Channel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 方法名称
|
||||
/// </summary>
|
||||
public string Method { get; set; } = "ReceiveMessage";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool IsDepartment { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class SpecialRihgtDto
|
||||
{
|
||||
// a.inneruserid,b.code,b.roleid,a.inneruserid,c.eid,c.uname,d.rightid,d.rname,d.remarks,e.typeid,e.cid
|
||||
public decimal inneruserid { get; set; }
|
||||
public string code { get; set; }
|
||||
public decimal roleid { get; set; }
|
||||
public decimal eid { get; set; }
|
||||
public string uname { get; set; }
|
||||
public string rightid { get; set; }
|
||||
public string rname { get; set; }
|
||||
public string remarks { get; set; }
|
||||
public decimal typeid { get; set; }
|
||||
public decimal cid { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class UpdateOrderRealNameDto
|
||||
{
|
||||
[Required]
|
||||
public List<decimal>? Orderids { get; set; }
|
||||
|
||||
public string? RealName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class UserInfoReq
|
||||
{
|
||||
public string uid { get; set; }
|
||||
|
||||
public string? appid { get; set; }
|
||||
|
||||
public string? appuserid { get; set; }
|
||||
|
||||
public string customerid { get; set; }
|
||||
|
||||
public string? resid { get; set; }
|
||||
public string? unionid { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Crm.Core.Domain.Config.SystemEnums;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class UserRoleLevelDto
|
||||
{
|
||||
public decimal Eid { get; set; }
|
||||
|
||||
public RoleLevel Level { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.CRM
|
||||
{
|
||||
public class WwHhuserEidDto
|
||||
{
|
||||
public string? USERID { get; set; }
|
||||
public string? CORPID { get; set; }
|
||||
public decimal? EID { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Customer
|
||||
{
|
||||
public class BestCustomerDto
|
||||
{
|
||||
public string? ResId { get; set; }
|
||||
public int? Eid { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? CropId { get; set; }
|
||||
public string? OutUserId { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Customer
|
||||
{
|
||||
public class GroupOrDeptIdDto
|
||||
{
|
||||
public string? DeptId { get; set; }
|
||||
public string? GroupIds { get; set; }
|
||||
}
|
||||
|
||||
public class UserDeptNameInfo
|
||||
{
|
||||
public decimal? Pkid { get; set; }
|
||||
public decimal? Eid { get; set; }
|
||||
public string? Uname { get; set; }
|
||||
public decimal? DeptId { get; set; }
|
||||
public string? DeptName { get; set; }
|
||||
public decimal? GroupId { get; set; }
|
||||
public string? GroupName { get; set; }
|
||||
}
|
||||
|
||||
public class BusinessLineInfo
|
||||
{
|
||||
public bool isLine { get; set; }
|
||||
public decimal deptId { get; set; }
|
||||
public List<decimal> eidInfo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Customer
|
||||
{
|
||||
public class SynchronousCustomerDto
|
||||
{
|
||||
public List<EmployeeDepartmentDetailItem> eddList { get; set; }
|
||||
//public List<EmployeeDepartmentItem> edList { get; set; }
|
||||
}
|
||||
public class EmployeeDepartmentDetailItem {
|
||||
public int id { get; set; }
|
||||
public int? eid { get; set; }
|
||||
public int department_id { get; set; }
|
||||
public int department_type { get; set; }
|
||||
|
||||
public int level { get; set; }
|
||||
public int is_deleted { get; set; }
|
||||
public DateTime create_time { get; set; }
|
||||
public DateTime update_time { get; set; }
|
||||
}
|
||||
public class EmployeeDepartmentItem {
|
||||
|
||||
public int id { get; set; }
|
||||
public int? eid { get; set; }
|
||||
public int department_id { get; set; }
|
||||
public string department_code { get; set; }
|
||||
|
||||
public int is_deleted { get; set; }
|
||||
public DateTime create_time { get; set; }
|
||||
public DateTime update_time { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class ListSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
[JsonPropertyName("currentPage")]
|
||||
public long? CurrentPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 每页记录数
|
||||
/// </summary>
|
||||
[JsonPropertyName("pageSize")]
|
||||
public long? PageSize { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveCourseProductsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("subproductid")]
|
||||
public int? SubproductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 在线客户峰值
|
||||
/// </summary>
|
||||
[JsonPropertyName("subproductname")]
|
||||
public string? SubProductName { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveCourseSummaryDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public int? Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 在线客户峰值
|
||||
/// </summary>
|
||||
[JsonPropertyName("max_viewer_num")]
|
||||
public decimal? MaxViewerNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LivePageDto<TTableData>
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
[JsonPropertyName("currentPage")]
|
||||
public long CurrentPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 每页记录数
|
||||
/// </summary>
|
||||
[JsonPropertyName("pageSize")]
|
||||
public long PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表数据
|
||||
/// </summary>
|
||||
[JsonPropertyName("tableData")]
|
||||
public List<TTableData> TableData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总记录数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total")]
|
||||
public long Total { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveScheduleDto : TreeDto
|
||||
{
|
||||
public int Deptid { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchCourseProductsDto
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 开课部门ID列表,逗号隔开
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptids")]
|
||||
public string? Deptids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_from")]
|
||||
public string? LivingDateFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程结束日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_to")]
|
||||
public string? LivingDateTo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchCourseSummaryDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public int? Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_from")]
|
||||
public string? LivingDateFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_to")]
|
||||
public string? LivingDateTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public string? LivingDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchPageDto : ListSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否只展示开课部门客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("only_dept")]
|
||||
public int OnlyDept { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售部门id
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_deptids")]
|
||||
public string? LivingDeptIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
//[JsonPropertyName("userId")]
|
||||
public decimal? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupids")]
|
||||
public string? GroupIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售组id
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
//[JsonPropertyName("txt_groupIds")]
|
||||
public string? Txt_groupIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 销售部门id
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
//[JsonPropertyName("txt_deptId")]
|
||||
public string? Txt_deptId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public decimal? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptids")]
|
||||
public string? Deptids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public decimal? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appid")]
|
||||
public string? Appid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企业号
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string? Appname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排除这个事业部关系
|
||||
/// </summary>
|
||||
[JsonPropertyName("exclude_deptid")]
|
||||
public int? ExcludeDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_from")]
|
||||
public string? LivingDateFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date_to")]
|
||||
public string? LivingDateTo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchUserRealTimePageDto : LiveSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工姓名
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interaction")]
|
||||
public int? Interaction { get; set; }
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为员工账号1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public int? UserType { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 是否连麦
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_online")]
|
||||
public int? IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// 购买行为
|
||||
/// </summary>
|
||||
[JsonPropertyName("buy_action")]
|
||||
public int? BuyAction { get; set; }
|
||||
/// <summary>
|
||||
/// 产品ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("subproductid")]
|
||||
public string? SubproductId { get; set; }
|
||||
/// <summary>
|
||||
/// 是否评论
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_finish")]
|
||||
public int? IsFinish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课时长大于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_from")]
|
||||
public int? WatchTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课时长小于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_to")]
|
||||
public int? WatchTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public int? Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public int? LivingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_from")]
|
||||
public string? EntryTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_to")]
|
||||
public string? EntryTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1表示直播中,0表示直播结束
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_living")]
|
||||
public int? IsLiving { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_from")]
|
||||
public string? CreateTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_to")]
|
||||
public string? CreateTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否去重
|
||||
/// </summary>
|
||||
[JsonPropertyName("whole")]
|
||||
public int? Whole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工状态 1: 在职 2: 离职
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_status")]
|
||||
public int? EmployeeStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleids")]
|
||||
public string? Scheduleids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否邀请 1 是 2否
|
||||
/// </summary>
|
||||
[JsonPropertyName("only_invite")]
|
||||
public int? onlyinvite { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchUserSummayPageDto : LiveSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工姓名
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interaction")]
|
||||
public int? Interaction { get; set; }
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为员工账号1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public int? UserType { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 听课时长大于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_from")]
|
||||
public int? WatchTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课时长小于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_to")]
|
||||
public int? WatchTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_from")]
|
||||
public string? EntryTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_to")]
|
||||
public string? EntryTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public int? Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public string? LivingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public decimal? WatchDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否连麦
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_online")]
|
||||
public int? IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1表示直播中,0表示直播结束
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_living")]
|
||||
public int? IsLiving { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_from")]
|
||||
public string? CreateTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_to")]
|
||||
public string? CreateTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否去重
|
||||
/// </summary>
|
||||
[JsonPropertyName("whole")]
|
||||
public int? Whole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工状态 1: 在职 2: 离职
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_status")]
|
||||
public int? EmployeeStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleids")]
|
||||
public string? Scheduleids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否邀请 1 是 2否
|
||||
/// </summary>
|
||||
[JsonPropertyName("only_invite")]
|
||||
public int? onlyinvite { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveSearchUserWeworkPageDto : LiveSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; } = "update_time desc";
|
||||
|
||||
/// <summary>
|
||||
/// 员工姓名
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为员工账号1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public int? UserType { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 是否连麦
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_mic")]
|
||||
public int? IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否评论
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_comment")]
|
||||
public int? IsFinish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课时长大于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_from")]
|
||||
public int? WatchTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课时长小于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_to")]
|
||||
public int? WatchTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_from")]
|
||||
public string? CreateTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_to")]
|
||||
public string? CreateTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否去重
|
||||
/// </summary>
|
||||
[JsonPropertyName("whole")]
|
||||
public int? Whole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工状态 1: 在职 2: 离职
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_status")]
|
||||
public int? EmployeeStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,304 @@
|
|||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveUserRealTimeDataDto
|
||||
{
|
||||
public LiveUserRealTimeDataDto(string app_id, string c_appid, string c_appuserid, string appuserid, string city, string country, long? customerid, string deptName,
|
||||
long? deptid, long? eid, string employeeName,int buyAction, string subproductName, string entryTime, string headimgurl, string ip, long isOnline,
|
||||
string lastTime, string livingDate, string nickname, long offlineTime, string province, string resid, long scheduleid,
|
||||
long? selfDeptid, long? selfEid, string title, string updateTime, long userType, long watchTime, int? inviterEid, int? isBelong, int? isWework,int? interaction, int interact_num)
|
||||
{
|
||||
app_id = app_id;
|
||||
Appuserid = appuserid;
|
||||
c_appid = c_appid;
|
||||
c_appuserid = c_appuserid;
|
||||
Interaction = interaction;
|
||||
InteractNum = interact_num;
|
||||
City = city;
|
||||
Country = country;
|
||||
Customerid = customerid;
|
||||
DeptName = deptName;
|
||||
Deptid = deptid;
|
||||
Eid = eid;
|
||||
EmployeeName = employeeName;
|
||||
BuyAction = buyAction;
|
||||
SubproductName = subproductName;
|
||||
EntryTime = entryTime;
|
||||
IsBelong = isBelong;
|
||||
IsWework = isWework;
|
||||
Headimgurl = headimgurl;
|
||||
Ip = ip;
|
||||
IsOnline = isOnline;
|
||||
LastTime = lastTime;
|
||||
LivingDate = livingDate;
|
||||
Nickname = nickname;
|
||||
OfflineTime = offlineTime;
|
||||
Province = province;
|
||||
Resid = resid;
|
||||
Scheduleid = scheduleid;
|
||||
SelfDeptid = selfDeptid;
|
||||
SelfEid = selfEid;
|
||||
Title = title;
|
||||
UpdateTime = updateTime;
|
||||
UserType = userType;
|
||||
WatchTime = watchTime;
|
||||
InviterEid = inviterEid;
|
||||
}
|
||||
|
||||
public LiveUserRealTimeDataDto()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_id")]
|
||||
public string app_id { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appid")]
|
||||
public string c_appid { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appuserid")]
|
||||
public string c_appuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interaction")]
|
||||
public int? Interaction { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interact_num")]
|
||||
public int? InteractNum { get; set; }
|
||||
/// <summary>
|
||||
/// 企微应用
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string AppName { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string Appuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[JsonPropertyName("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1表示直播中,0表示直播结束
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_living")]
|
||||
public int IsLiving { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[JsonPropertyName("country")]
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户主账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("customerid")]
|
||||
public long? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_name")]
|
||||
public string DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public long? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public long? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string EmployeeName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否属于归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
/// 购买行为
|
||||
/// </summary>
|
||||
[JsonPropertyName("buy_action")]
|
||||
public int? BuyAction { get; set; }
|
||||
/// <summary>
|
||||
/// 产品ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("subproductname")]
|
||||
public string? SubproductName { get; set; }
|
||||
/// <summary>
|
||||
/// 进入直播时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time")]
|
||||
public string EntryTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string Headimgurl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
[JsonPropertyName("ip")]
|
||||
public string Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在线
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_online")]
|
||||
public long IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后离开时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("last_time")]
|
||||
public string LastTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public string LivingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 离线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("offline_time")]
|
||||
public long OfflineTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份
|
||||
/// </summary>
|
||||
[JsonPropertyName("province")]
|
||||
public string Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public long Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_deptid")]
|
||||
public long? SelfDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_eid")]
|
||||
public long? SelfEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("update_time")]
|
||||
public string UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型,0:员工,1:客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public long UserType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time")]
|
||||
public long WatchTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时间(中文)
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_str")]
|
||||
public string WatchTimeStr
|
||||
{ get { return Utility.SecondToHour(WatchTime); } }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Userid { get; set; }
|
||||
|
||||
[JsonPropertyName("inviter_eid")]
|
||||
public int? InviterEid { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveUserStatDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户数量
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_num")]
|
||||
public int UserNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工数量
|
||||
/// </summary>
|
||||
[JsonPropertyName("staff_num")]
|
||||
public int StaffNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 全部事业部的用户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_num")]
|
||||
public int TotalNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长超过20分钟人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_num_20")]
|
||||
public int WatchNum20 { get; set; }
|
||||
/// <summary>
|
||||
/// 客户互动数
|
||||
/// </summary>
|
||||
[JsonPropertyName("interact_num")]
|
||||
public int InteractNum { get; set; }
|
||||
/// <summary>
|
||||
/// 观看时长超过30分钟人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_num_30")]
|
||||
public int WatchNum30 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public double AvgWatchTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// </summary>
|
||||
public string AvgWatchTimeStr { get { return Utility.SecondToHour(AvgWatchTime); } }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveUserSummayDataDto
|
||||
{
|
||||
public LiveUserSummayDataDto(string app_id,string c_appid,string c_appuserid, string appuserid, string city, string country, long? customerid, string deptName,
|
||||
long? deptid, long? eid, string employeeName, string endTime, string headimgurl, string ip, string livingId, string nickname,
|
||||
string province, string resid, long scheduleid, object selfDeptid, object selfEid, string startTime, string title, string totalWatchTime,
|
||||
string updateTime, long userType, string watchDays, int? inviterEid,int? isBelong,int? isWework,int? interaction,int interact_num)
|
||||
{
|
||||
app_id = app_id;
|
||||
c_appid = c_appid;
|
||||
c_appuserid = c_appuserid;
|
||||
Interaction = interaction;
|
||||
InteractNum = interact_num;
|
||||
Appuserid = appuserid;
|
||||
City = city;
|
||||
Country = country;
|
||||
Customerid = customerid;
|
||||
DeptName = deptName;
|
||||
Deptid = deptid;
|
||||
Eid = eid;
|
||||
EmployeeName = employeeName;
|
||||
IsBelong = isBelong;
|
||||
IsWework = isWework;
|
||||
EndTime = endTime;
|
||||
Headimgurl = headimgurl;
|
||||
Ip = ip;
|
||||
LivingId = livingId;
|
||||
Nickname = nickname;
|
||||
Province = province;
|
||||
Resid = resid;
|
||||
Scheduleid = scheduleid;
|
||||
SelfDeptid = selfDeptid;
|
||||
SelfEid = selfEid;
|
||||
StartTime = startTime;
|
||||
Title = title;
|
||||
TotalWatchTime = totalWatchTime;
|
||||
UpdateTime = updateTime;
|
||||
UserType = userType;
|
||||
WatchDays = watchDays;
|
||||
InviterEid = inviterEid;
|
||||
}
|
||||
|
||||
public LiveUserSummayDataDto()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_id")]
|
||||
public string app_id { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appid")]
|
||||
public string c_appid { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appuserid")]
|
||||
public string c_appuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interaction")]
|
||||
public int? Interaction { get; set; }
|
||||
/// <summary>
|
||||
/// 直播中互动,1:有,0:无
|
||||
/// </summary>
|
||||
[JsonPropertyName("interact_num")]
|
||||
public int? InteractNum { get; set; }
|
||||
/// <summary>
|
||||
/// 企微应用
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string AppName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用用户账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string Appuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[JsonPropertyName("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[JsonPropertyName("country")]
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户主账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("customerid")]
|
||||
public long? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_name")]
|
||||
public string DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public long? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public long? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string EmployeeName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否属于归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
/// <summary>
|
||||
/// 最后观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_time")]
|
||||
public string EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string Headimgurl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
[JsonPropertyName("ip")]
|
||||
public string Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_id")]
|
||||
public string LivingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份
|
||||
/// </summary>
|
||||
[JsonPropertyName("province")]
|
||||
public string Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public long Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_deptid")]
|
||||
public object SelfDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_eid")]
|
||||
public object SelfEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("start_time")]
|
||||
public string StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_watch_time")]
|
||||
public string TotalWatchTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("update_time")]
|
||||
public string UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型,0:员工,1:客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public long UserType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public string WatchDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
public string TotalWatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(TotalWatchTime));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// total_watch_time / watch_days
|
||||
/// </summary>
|
||||
public string AvgWatchTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(TotalWatchTime) ||
|
||||
string.IsNullOrEmpty(WatchDays) ||
|
||||
!int.TryParse(TotalWatchTime, out int totalWatchTime) ||
|
||||
!int.TryParse(WatchDays, out int watchDays))
|
||||
{
|
||||
return "--";
|
||||
}
|
||||
return watchDays == 0 ? "--" : Utility.SecondToHour(totalWatchTime / watchDays);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Userid { get; set; }
|
||||
|
||||
[JsonPropertyName("inviter_eid")]
|
||||
public int? InviterEid { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveUserWeworkDataDto
|
||||
{
|
||||
public LiveUserWeworkDataDto(string livingId, string app_id, string c_appid, string c_appuserid, string appuserid, string title, long? customerid, string resid, long? selfDeptid, long? selfEid, long userType, string nickname, string deptName, long? deptid, long? eid, string employeeName, string headimgurl, long isOnline, int? isFinish, string updateTime, long watchTime, int? is_wework)
|
||||
{
|
||||
LivingId = livingId;
|
||||
app_id = app_id;
|
||||
c_appid = c_appid;
|
||||
c_appuserid = c_appuserid;
|
||||
Appuserid = appuserid;
|
||||
Title = title;
|
||||
Customerid = customerid;
|
||||
Resid = resid;
|
||||
SelfDeptid = selfDeptid;
|
||||
SelfEid = selfEid;
|
||||
UserType = userType;
|
||||
Nickname = nickname;
|
||||
DeptName = deptName;
|
||||
Deptid = deptid;
|
||||
Eid = eid;
|
||||
EmployeeName = employeeName;
|
||||
Headimgurl = headimgurl;
|
||||
IsOnline = isOnline;
|
||||
IsFinish = isFinish;
|
||||
UpdateTime = updateTime;
|
||||
WatchTime = watchTime;
|
||||
this.is_wework = is_wework;
|
||||
}
|
||||
|
||||
public LiveUserWeworkDataDto() { }
|
||||
|
||||
[JsonPropertyName("living_id")]
|
||||
public string LivingId { get; set; }
|
||||
|
||||
[JsonPropertyName("living_date")]
|
||||
public string LivingDate { get; set; }
|
||||
|
||||
[JsonPropertyName("appname")]
|
||||
public string Appname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_id")]
|
||||
public string app_id { get; set; }
|
||||
/// <summary>
|
||||
/// 应用ID(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appid")]
|
||||
public string c_appid { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号(无resid时用作查线索)
|
||||
/// </summary>
|
||||
[JsonPropertyName("c_appuserid")]
|
||||
public string c_appuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 企微应用
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string AppName { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? is_wework { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string Appuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户主账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("customerid")]
|
||||
public long? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_deptid")]
|
||||
public long? SelfDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_eid")]
|
||||
public long? SelfEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型,0:员工,1:客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public long UserType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_name")]
|
||||
public string DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public long? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public long? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string Headimgurl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否在线
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_mic")]
|
||||
public long IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否评论
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_comment")]
|
||||
public int? IsFinish { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("update_time")]
|
||||
public string UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time")]
|
||||
public long WatchTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时间(中文)
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_str")]
|
||||
public string WatchTimeStr { get { return Utility.SecondToHour(WatchTime); } }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Userid { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Live
|
||||
{
|
||||
public class LiveWeworkStatDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户数量
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_num")]
|
||||
public int UserNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工数量
|
||||
/// </summary>
|
||||
[JsonPropertyName("staff_num")]
|
||||
public int StaffNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 全部事业部的用户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_num")]
|
||||
public int TotalNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长超过20分钟人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_num_20")]
|
||||
public int WatchNum20 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长超过30分钟人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_num_30")]
|
||||
public int WatchNum30 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public double AvgWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// </summary>
|
||||
public string AvgWatchTimeStr
|
||||
{
|
||||
get { return Utility.SecondToHour(AvgWatchTime); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,293 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackDetailDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_id")]
|
||||
public string? Appid { get; set; }
|
||||
|
||||
[JsonPropertyName("c_appid")]
|
||||
public string? CAppid { get; set; }
|
||||
/// <summary>
|
||||
/// 企微应用
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string? AppName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
/// <summary>
|
||||
/// 应用用户账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string? Appuserid { get; set; }
|
||||
|
||||
[JsonPropertyName("c_appuserid")]
|
||||
public string? CAppuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[JsonPropertyName("city")]
|
||||
public string? City { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[JsonPropertyName("country")]
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户主账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("customerid")]
|
||||
public long? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_name")]
|
||||
public string? DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public long? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public long? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_time")]
|
||||
public string? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string? Headimgurl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
[JsonPropertyName("ip")]
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_id")]
|
||||
public string? LivingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份
|
||||
/// </summary>
|
||||
[JsonPropertyName("province")]
|
||||
public string? Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleids")]
|
||||
public long Scheduleids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_deptid")]
|
||||
public object SelfDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_eid")]
|
||||
public object SelfEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("start_time")]
|
||||
public string? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_watch_time")]
|
||||
public decimal? TotalWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 回放时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time")]
|
||||
public decimal? WatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 回放时长显示字符串
|
||||
/// </summary>
|
||||
public string? WatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(WatchTime.ToString()));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 平均每次时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public decimal? AvgWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 平均每次时长显示字符串
|
||||
/// </summary>
|
||||
public string? AvgWatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(AvgWatchTime.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("update_time")]
|
||||
public string? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型,0:员工,1:客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public long UserType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进入时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time")]
|
||||
public string? EntryTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("last_time")]
|
||||
public string? LastTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 观看天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public decimal? WatchDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
public string? TotalWatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(TotalWatchTime.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 平均观看时长
|
||||
/// total_watch_time / watch_days
|
||||
/// </summary>
|
||||
//public string? AvgWatchTime
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (TotalWatchTime == null ||
|
||||
// WatchDays == null ||
|
||||
// !int.TryParse(TotalWatchTime.ToString(), out int totalWatchTime) ||
|
||||
// !int.TryParse(WatchDays.ToString(), out int watchDays))
|
||||
// {
|
||||
// return "--";
|
||||
// }
|
||||
// return watchDays == 0 ? "--" : Utility.SecondToHour(totalWatchTime / watchDays);
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
/// <summary>
|
||||
/// 回放次数
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_times")]
|
||||
public decimal? AvgWatchTimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Userid { get; set; }
|
||||
|
||||
[JsonPropertyName("inviter_eid")]
|
||||
public int? InviterEid { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackDetailPageDto : LiveSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工姓名
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; }
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为员工账号1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public int? UserType { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
/// <summary>
|
||||
/// 回放天数大于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_from")]
|
||||
public int? WatchTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放天数小于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_time_to")]
|
||||
public int? WatchTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放开始日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("act_date_from")]
|
||||
public string? ActDateFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放结束日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("act_date_to")]
|
||||
public string? ActDateTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_from")]
|
||||
public string? EntryTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_to")]
|
||||
public string? EntryTimeTo { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长大于等于
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time_from")]
|
||||
public string? avgWatchTimeFrom { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长小于于等于
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time_to")]
|
||||
public string? avgWatchTimeTo { get; set; }
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleids")]
|
||||
public string? Scheduleids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public string? LivingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public decimal? WatchDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否连麦
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_online")]
|
||||
public int? IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1表示直播中,0表示直播结束
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_living")]
|
||||
public int? IsLiving { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_from")]
|
||||
public string? CreateTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_to")]
|
||||
public string? CreateTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否去重
|
||||
/// </summary>
|
||||
[JsonPropertyName("whole")]
|
||||
public int? Whole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工状态 1: 在职 2: 离职
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_status")]
|
||||
public int? EmployeeStatus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否邀请 1 是 2否
|
||||
/// </summary>
|
||||
[JsonPropertyName("only_invite")]
|
||||
public int? onlyinvite { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackDetailStatDto
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 回放员工数
|
||||
/// </summary>
|
||||
[JsonPropertyName("staff_user")]
|
||||
public int StaffUser { get; set; }
|
||||
/// <summary>
|
||||
/// 全部回放客户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_user")]
|
||||
public int TotalUser { get; set; }
|
||||
/// <summary>
|
||||
/// 本事业部回放客户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_user")]
|
||||
public int DeptUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放20分钟以上人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_20_user")]
|
||||
public int Watch20User { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public double AvgWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长显示字符
|
||||
/// </summary>
|
||||
public string AvgWatchTimeStr
|
||||
{
|
||||
get { return Utility.SecondToHour(AvgWatchTime); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 平均回放次数
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_times")]
|
||||
public int AvgWatchTimes { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackPageDto<TTableData, TStatData>
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
[JsonPropertyName("currentPage")]
|
||||
public long CurrentPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 每页记录数
|
||||
/// </summary>
|
||||
[JsonPropertyName("pageSize")]
|
||||
public long PageSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表数据
|
||||
/// </summary>
|
||||
[JsonPropertyName("tableData")]
|
||||
public List<TTableData>? TableData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 汇总数据
|
||||
/// </summary>
|
||||
[JsonPropertyName("statData")]
|
||||
public TStatData? StatData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总记录数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total")]
|
||||
public long Total { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackSummayDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_id")]
|
||||
public string? Appid { get; set; }
|
||||
|
||||
[JsonPropertyName("c_appid")]
|
||||
public string? c_appid { get; set; }
|
||||
/// <summary>
|
||||
/// 企微应用
|
||||
/// </summary>
|
||||
[JsonPropertyName("app_name")]
|
||||
public string? AppName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用用户账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string? Appuserid { get; set; }
|
||||
|
||||
[JsonPropertyName("c_appuserid")]
|
||||
public string? c_appuserid { get; set; }
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
[JsonPropertyName("city")]
|
||||
public string? City { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? isWework { get; set; }
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
[JsonPropertyName("country")]
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户主账号
|
||||
/// </summary>
|
||||
[JsonPropertyName("customerid")]
|
||||
public long? Customerid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_name")]
|
||||
public string? DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("deptid")]
|
||||
public long? Deptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("eid")]
|
||||
public long? Eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_time")]
|
||||
public string? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
[JsonPropertyName("headimgurl")]
|
||||
public string? Headimgurl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
/// </summary>
|
||||
[JsonPropertyName("ip")]
|
||||
public string? Ip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_id")]
|
||||
public string? LivingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份
|
||||
/// </summary>
|
||||
[JsonPropertyName("province")]
|
||||
public string? Province { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("umid")]
|
||||
public string? Umid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public long Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身部门ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_deptid")]
|
||||
public object SelfDeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自身工号
|
||||
/// </summary>
|
||||
[JsonPropertyName("self_eid")]
|
||||
public object SelfEid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始观看时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("start_time")]
|
||||
public string? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_watch_time")]
|
||||
public decimal? TotalWatchTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("update_time")]
|
||||
public string? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型,0:员工,1:客户
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public long UserType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 观看天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public decimal? WatchDays { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
/// <summary>
|
||||
/// 观看时长
|
||||
/// </summary>
|
||||
public string? TotalWatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(TotalWatchTime.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 平均每次时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public decimal? AvgWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 平均每次时长显示字符串
|
||||
/// </summary>
|
||||
public string? AvgWatchTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return Utility.SecondToHour(double.Parse(AvgWatchTime.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[JsonPropertyName("group_name")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time")]
|
||||
public string? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 企微客服id
|
||||
/// </summary>
|
||||
[JsonPropertyName("userid")]
|
||||
public string? Userid { get; set; }
|
||||
|
||||
[JsonPropertyName("inviter_eid")]
|
||||
public int? InviterEid { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackSummayPageDto : LiveSearchPageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 员工姓名
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_name")]
|
||||
public string? EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("resid")]
|
||||
public string? Resid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户昵称
|
||||
/// </summary>
|
||||
[JsonPropertyName("nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
[JsonPropertyName("sortBy")]
|
||||
public string? SortBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程名称
|
||||
/// </summary>
|
||||
[JsonPropertyName("title")]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为员工账号1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("user_type")]
|
||||
public int? UserType { get; set; }
|
||||
/// <summary>
|
||||
/// 好友关系 1:是,0:否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_wework")]
|
||||
public int? IsWework { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放天数大于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_day_from")]
|
||||
public int? WatchDayFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放天数小于
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_day_to")]
|
||||
public int? WatchDayTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放开始日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("act_date_from")]
|
||||
public string? ActDateFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放结束日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("act_date_to")]
|
||||
public string? ActDateTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播开始进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_from")]
|
||||
public string? EntryTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播结束进入日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("entry_time_to")]
|
||||
public string? EntryTimeTo { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长大于等于
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time_from")]
|
||||
public string? AvgWatchTimeFrom { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长小于于等于
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time_to")]
|
||||
public string? AvgWatchTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleid")]
|
||||
public int? Scheduleid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程日期
|
||||
/// </summary>
|
||||
[JsonPropertyName("living_date")]
|
||||
public string? LivingDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组别id
|
||||
/// </summary>
|
||||
[JsonPropertyName("groupid")]
|
||||
public decimal? Groupid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 听课天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_days")]
|
||||
public decimal? WatchDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否连麦
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_online")]
|
||||
public int? IsOnline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1表示直播中,0表示直播结束
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_living")]
|
||||
public int? IsLiving { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_from")]
|
||||
public string? CreateTimeFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进线时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("create_time_to")]
|
||||
public string? CreateTimeTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否去重
|
||||
/// </summary>
|
||||
[JsonPropertyName("whole")]
|
||||
public int? Whole { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工状态 1: 在职 2: 离职
|
||||
/// </summary>
|
||||
[JsonPropertyName("employee_status")]
|
||||
public int? EmployeeStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 课程ID
|
||||
/// </summary>
|
||||
[JsonPropertyName("scheduleids")]
|
||||
public string? Scheduleids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否邀请 1 是 2否
|
||||
/// </summary>
|
||||
[JsonPropertyName("only_invite")]
|
||||
public int? Onlyinvite { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否归属 1 是 0 否
|
||||
/// </summary>
|
||||
[JsonPropertyName("is_belong")]
|
||||
public int? IsBelong { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.LivePlayback
|
||||
{
|
||||
public class LivePlaybackSummayStatDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 回放员工数
|
||||
/// </summary>
|
||||
[JsonPropertyName("staff_user")]
|
||||
public int StaffUser { get; set; }
|
||||
/// <summary>
|
||||
/// 全部回放客户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("total_user")]
|
||||
public int TotalUser { get; set; }
|
||||
/// <summary>
|
||||
/// 本事业部回放客户数
|
||||
/// </summary>
|
||||
[JsonPropertyName("dept_user")]
|
||||
public int DeptUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回放20分钟以上人数
|
||||
/// </summary>
|
||||
[JsonPropertyName("watch_20_user")]
|
||||
public int Watch20User { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回看时长
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_time")]
|
||||
public double AvgWatchTime { get; set; }
|
||||
/// <summary>
|
||||
/// 平均回放时长显示字符
|
||||
/// </summary>
|
||||
public string AvgWatchTimeStr
|
||||
{
|
||||
get { return Utility.SecondToHour(AvgWatchTime); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 平均回放天数
|
||||
/// </summary>
|
||||
[JsonPropertyName("avg_watch_days")]
|
||||
public int AvgWatchDays { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Order
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建订单分成
|
||||
/// </summary>
|
||||
public class CreateCommissionRuleDto
|
||||
{
|
||||
public decimal orderId { get; set; }
|
||||
public decimal userId { get; set; }
|
||||
public decimal? szzyOrderId { get; set; }
|
||||
public decimal? ratio { get; set; }
|
||||
public decimal ismain { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,286 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Order
|
||||
{
|
||||
public class GetCreateOrderQueryDto
|
||||
{
|
||||
public int? eid { get; set; }
|
||||
public int? deptid { get; set; }
|
||||
public string? appid { get; set; }
|
||||
public string? extuserid { get; set; }
|
||||
}
|
||||
|
||||
public class CreateOrderInfo
|
||||
{
|
||||
public List<RescustomerInfo> userinfos { get; set; }
|
||||
public List<DeptList> deptLists { get; set; }
|
||||
public List<MinProductInfo> minProductInfos { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小类
|
||||
/// </summary>
|
||||
public class MinProductInfo
|
||||
{
|
||||
public decimal? minproductid { get; set; }
|
||||
public string? minproductname { get; set; }
|
||||
}
|
||||
|
||||
public class DeptList
|
||||
{
|
||||
public string? deptname { get; set; }
|
||||
public string? saledeptcode { get; set; }
|
||||
public bool? selected { get; set; }
|
||||
}
|
||||
|
||||
public class RescustomerInfo
|
||||
{
|
||||
public string? umid { get; set; }
|
||||
public string? username { get; set; }
|
||||
public string? cname { get; set; }
|
||||
}
|
||||
|
||||
public class ProductQueryByMinProductId
|
||||
{
|
||||
public int? deptid { get; set; }
|
||||
public int? minProductId { get; set; }
|
||||
}
|
||||
|
||||
public class ProductInfo
|
||||
{
|
||||
public string? productCode { get; set; }
|
||||
public string? productName { get; set; }
|
||||
}
|
||||
|
||||
public class ProductQueryDto
|
||||
{
|
||||
public int? deptid { get; set; }
|
||||
public string productcode { get; set; }
|
||||
}
|
||||
|
||||
public class ProductDetail
|
||||
{
|
||||
public decimal? price { get; set; }
|
||||
public decimal? days { get; set; }
|
||||
public string discount { get; set; }
|
||||
public List<decimal> customprisce { get; set; }
|
||||
public List<DiscountArea> discountAreas { get; set; } = new List<DiscountArea>();
|
||||
public List<GiftInfo> giftInfos { get; set; } = new List<GiftInfo>();
|
||||
public List<GiftInfo> othergiftInfos { get; set; } = new List<GiftInfo>();
|
||||
}
|
||||
|
||||
public class DiscountArea
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public decimal? Min { get; set; }
|
||||
public decimal? Max { get; set; }
|
||||
public decimal? MinRate { get; set; }
|
||||
public decimal? MaxRate { get; set; }
|
||||
public int IsShow { get; set; }
|
||||
}
|
||||
|
||||
public class GiftInfo
|
||||
{
|
||||
public decimal? giftday { get; set; }
|
||||
public string? giftdayname { get; set; }
|
||||
public string? giftname { get; set; }
|
||||
}
|
||||
|
||||
public class CreateOrderDto
|
||||
{
|
||||
public int deptid { get; set; }
|
||||
public int? eid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string softUsername { get; set; }
|
||||
|
||||
public string productCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 新订单 2 续费 3 升级
|
||||
/// </summary>
|
||||
public int orderType { get; set; } = 1;
|
||||
|
||||
public string? remark { get; set; }
|
||||
public string? saledeptid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 为企微留痕 2 为手机号 3
|
||||
/// </summary>
|
||||
public string? source { get; set; } = "2";
|
||||
|
||||
public string? upgradeorderids { get; set; }
|
||||
public int? giftdays { get; set; }
|
||||
|
||||
public int? giftdays2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 折后价格 与 pricerange 只能传一个
|
||||
/// </summary>
|
||||
public decimal? customprisce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 价格区间
|
||||
/// </summary>
|
||||
public decimal? pricerange { get; set; }
|
||||
|
||||
public string? deptCode { get; set; }
|
||||
public string? appid { get; set; }
|
||||
public string? appuserid { get; set; }
|
||||
public string? extuserid {get;set;}
|
||||
public List<payInfo>? payInfo { get; set; } = new List<payInfo>();
|
||||
}
|
||||
|
||||
#region
|
||||
|
||||
public class payInfo
|
||||
{
|
||||
public DateTime? paydate { get; set; }
|
||||
public string payname { get; set; }
|
||||
public string payno { get; set; }
|
||||
public decimal payprice { get; set; }
|
||||
public int paytype { get; set; }
|
||||
public string? remark { get; set; }
|
||||
}
|
||||
|
||||
public class OrderuseDto
|
||||
{
|
||||
public int orderid { get; set; }
|
||||
public decimal needpay { get; set; }
|
||||
public decimal arrivalpay { get; set; }
|
||||
}
|
||||
|
||||
public class PayPostZxdDto
|
||||
{
|
||||
public string resid { get; set; }
|
||||
public int? channel { get; set; }
|
||||
public string deptcode { get; set; }
|
||||
public List<PayInfoDto> paylist { get; set; }
|
||||
public List<OrderuseDto> orderuselist { get; set; }
|
||||
}
|
||||
|
||||
public class PayInfoDto
|
||||
{
|
||||
public string resid { get; set; }
|
||||
public int paytype { get; set; }
|
||||
public string paytypename { get; set; }
|
||||
public DateTime? paydate { get; set; }
|
||||
public decimal payprice { get; set; }
|
||||
public string payname { get; set; }
|
||||
public string remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直接去除前后空格
|
||||
/// </summary>
|
||||
public string payno
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public int isuse { get; set; }
|
||||
public string companycode { get; set; }
|
||||
public string tradeno { get; set; }
|
||||
public int? creator { get; set; }
|
||||
public string creatorname { get; set; }
|
||||
public DateTime? checkpaytime { get; set; }
|
||||
}
|
||||
|
||||
public class ordermodel
|
||||
{
|
||||
public string umid { get; set; }
|
||||
public decimal userid { get; set; }
|
||||
public decimal productId { get; set; }
|
||||
public decimal subProductId { get; set; }
|
||||
public string productname { get; set; }
|
||||
public string subproductname { get; set; }
|
||||
|
||||
public string productcode { get; set; }
|
||||
public string bigproductcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 0-单一产品、1-组合产品
|
||||
/// </summary>
|
||||
public int productType { get; set; }
|
||||
|
||||
public string mobile { get; set; }
|
||||
public string source { get; set; }
|
||||
public string cname { get; set; }
|
||||
public decimal? ordertype { get; set; }
|
||||
public decimal? needpay { get; set; }
|
||||
public decimal? teamserve { get; set; }
|
||||
public decimal? saledeptid { get; set; }
|
||||
public string remark { get; set; }
|
||||
public decimal? opendays { get; set; }
|
||||
|
||||
public string softusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单数量
|
||||
/// </summary>
|
||||
public int count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司ID,用于推送标志
|
||||
/// </summary>
|
||||
public string companycode { get; set; }
|
||||
|
||||
public string upgradeorderids { get; set; }
|
||||
|
||||
public decimal? totalupgradevalue { get; set; }
|
||||
|
||||
public int istest { get; set; }
|
||||
public int? giftdays { get; set; }
|
||||
|
||||
public int? giftdays2 { get; set; }
|
||||
public string external_userid { get; set; }
|
||||
public string corpid { get; set; }
|
||||
public string jobuserid { get; set; }
|
||||
public string wework_remoteid { get; set; }
|
||||
public string customerusername { get; set; }
|
||||
public string fujian { get; set; }
|
||||
public decimal? channel { get; set; }
|
||||
public decimal? discount { get; set; }
|
||||
public decimal? customprisce { get; set; }
|
||||
public string deptcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 预计开通时间
|
||||
/// </summary>
|
||||
public DateTime? estimateotime { get; set; }
|
||||
|
||||
public decimal? eid { get; set; }
|
||||
public string ai_hgrecord_stime { get; set; }
|
||||
public string ai_hgrecord_etime { get; set; }
|
||||
}
|
||||
|
||||
public class CreateOrderRsp
|
||||
{
|
||||
public int retCode { get; set; } //状态码同旧有逻辑
|
||||
public string orderId { get; set; } //Node.JS接口返回的订单号
|
||||
public string selfOirderId { get; set; } //中心点自己生成的ID
|
||||
public string userName { get; set; }
|
||||
public string retMsg { get; set; }
|
||||
}
|
||||
|
||||
public class retMsg<T>
|
||||
{
|
||||
public bool result { get; set; }
|
||||
public int retcode { get; set; }
|
||||
public T retmsg { get; set; }
|
||||
}
|
||||
|
||||
public class DepositInfoDto
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string payno { get; set; }
|
||||
public string companycode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Wework
|
||||
{
|
||||
public class WeworkResponse<T>
|
||||
{
|
||||
[JsonPropertyName("errcode")]
|
||||
public int? ErrCode { get; set; }
|
||||
|
||||
[JsonPropertyName("errmsg")]
|
||||
public string? RrrMessage { get; set; }
|
||||
|
||||
[JsonPropertyName("data")]
|
||||
public T? Data { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Dto.Zxd
|
||||
{
|
||||
public class DeptMentDto
|
||||
{
|
||||
public string? Eid { get; set; }
|
||||
public int? DeptId { get; set; }
|
||||
public string? DeptName { get; set; }
|
||||
public string? CompanyCode { get; set; }
|
||||
public string? AppId { get; set; }
|
||||
public int? SaleDeptId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
using Confluent.Kafka;
|
||||
using Crm.Core.Domain.Dto.CRM;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System.Security.Cryptography;
|
||||
using static System.Formats.Asn1.AsnWriter;
|
||||
|
||||
namespace Crm.Core.Domain.Hubs
|
||||
{
|
||||
public class NotificationHub : Hub
|
||||
{
|
||||
private readonly IRedisManager _redisManager;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public NotificationHub(IRedisManager redisManager,
|
||||
IServiceProvider serviceProvider)
|
||||
{
|
||||
_redisManager = redisManager;
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
public async Task EnqueueQueue(OrderUserProtectionDto orderUserProtectionDto)
|
||||
{
|
||||
await _redisManager.EnqueueAsync(CacheKeys.MssagesKey, orderUserProtectionDto);
|
||||
}
|
||||
|
||||
public async Task<long> GetQueue()
|
||||
{
|
||||
return await _redisManager.CountAsync(CacheKeys.MssagesKey);
|
||||
}
|
||||
|
||||
public async Task<OrderUserProtectionDto> DequeueQueue()
|
||||
{
|
||||
return await _redisManager.DequeueAsync<OrderUserProtectionDto>(CacheKeys.MssagesKey);
|
||||
}
|
||||
|
||||
public async Task EnqueueStatisticsQueue(OrderUserProtectionDto orderUserProtectionDto)
|
||||
{
|
||||
await _redisManager.EnqueueAsync(CacheKeys.StatisticsKey, orderUserProtectionDto);
|
||||
}
|
||||
|
||||
public async Task<long> GetStatisticsQueue()
|
||||
{
|
||||
return await _redisManager.CountAsync(CacheKeys.StatisticsKey);
|
||||
}
|
||||
|
||||
public async Task<OrderUserProtectionDto> DequeueStatisticsQueue()
|
||||
{
|
||||
return await _redisManager.DequeueAsync<OrderUserProtectionDto>(CacheKeys.StatisticsKey);
|
||||
}
|
||||
|
||||
public async Task SendOrderUserProtectionMessage(OrderUserProtectionDto orderUserProtectionDto)
|
||||
{
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var list = await GetList();
|
||||
var cacheDomain = scope.ServiceProvider.GetRequiredService<ICacheDomain>();
|
||||
var enabled = await cacheDomain.GetValueParameter(ParameterEnums.CRM_CORE_NOTIFICATION_ENABLED);
|
||||
var excludeEids = await cacheDomain.GetParameter<List<decimal>>(ParameterEnums.CRM_CORE_NOTIFICATION_EXCLUDE);
|
||||
var repeatDeptid = orderUserProtectionDto.repeat_deptid;
|
||||
if (repeatDeptid.HasValue)
|
||||
{
|
||||
if (repeatDeptid == 0)
|
||||
{
|
||||
Log.Error($"重复的事业部id为0,排除异常数据!");
|
||||
return;
|
||||
}
|
||||
var appid = await cacheDomain.GetAppidByDeptmentId((decimal)repeatDeptid);
|
||||
if (string.IsNullOrEmpty(appid))
|
||||
{
|
||||
Log.Error($"找不到重复的事业部id{repeatDeptid}");
|
||||
return;
|
||||
}
|
||||
var eid = orderUserProtectionDto.repeat_eid ?? 0;
|
||||
// 如果排除了名单就不发送通知
|
||||
if (excludeEids != null && excludeEids.Any() && excludeEids.Contains(eid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var connectionIds = list.Where(x => x.Eid == eid && x.Appid == appid).Select(x => x.ConnectionId ?? "").ToList();
|
||||
var message = $"昵称:{orderUserProtectionDto.nickname},真实姓名:{orderUserProtectionDto.name},客户ID:{orderUserProtectionDto.umid},成交保护期: {orderUserProtectionDto.deptname}{orderUserProtectionDto.EndTimeStr};权限到期时间:{orderUserProtectionDto.OrderPassTimeStr};,已经成交,您若不是他/她的成交客服,为了避免重复营销,请将他/她企微账号屏蔽和删除,请帮忙配合。";
|
||||
var notificationDomain = scope.ServiceProvider.GetRequiredService<INotificationDomain>();
|
||||
var notification = await notificationDomain.InsetNotification(orderUserProtectionDto, message);
|
||||
var count = await notificationDomain.GetMessageCount(eid);
|
||||
if (count > 99)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (connectionIds != null && connectionIds.Any() && Clients != null && enabled == "1")
|
||||
{
|
||||
|
||||
var clients = Clients.Clients(connectionIds);
|
||||
await clients.SendAsync("ReceiveMessage", message, notification.ID, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InsetStatistics(OrderUserProtectionDto orderUserProtectionDto)
|
||||
{
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var notificationDomain = scope.ServiceProvider.GetRequiredService<INotificationDomain>();
|
||||
var cacheDomain = scope.ServiceProvider.GetRequiredService<ICacheDomain>();
|
||||
var excludeEids = await cacheDomain.GetParameter<List<decimal>>(ParameterEnums.CRM_CORE_NOTIFICATION_EXCLUDE);
|
||||
var eid = orderUserProtectionDto.repeat_eid ?? 0;
|
||||
// 如果排除了名单就不纳入统计
|
||||
if (excludeEids != null && excludeEids.Any() && excludeEids.Contains(eid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
await notificationDomain.InsetNotificationStatistics(orderUserProtectionDto);
|
||||
}
|
||||
|
||||
public async Task Send(BAS_NOTIFICATION notification)
|
||||
{
|
||||
var list = await GetList();
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var connectionIds = list.Where(x => x.Eid == notification.EID).Select(x => x.ConnectionId ?? "").ToList();
|
||||
if (connectionIds != null && connectionIds.Any())
|
||||
{
|
||||
var notificationDomain = scope.ServiceProvider.GetRequiredService<INotificationDomain>();
|
||||
var count = await notificationDomain.GetMessageCount(notification.EID, notification.NOTIFICATIONTYPE);
|
||||
var clients = Clients.Clients(connectionIds);
|
||||
await clients.SendAsync(notification.NOTIFICATIONTYPE?.ToString() ?? "ReceiveMessage", notification.MESSAGE, notification.ID, count);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SendMessage(SendMessageDto dto)
|
||||
{
|
||||
var list = await GetList();
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var cacheDomain = scope.ServiceProvider.GetRequiredService<ICacheDomain>();
|
||||
var appid = await cacheDomain.GetAppidByDeptmentId(dto.Deptid ?? 0);
|
||||
var notificationDomain = scope.ServiceProvider.GetRequiredService<INotificationDomain>();
|
||||
var notification = await notificationDomain.InsetNotification(dto);
|
||||
var connectionIds = list.Where(x => x.Eid == dto.Eid && x.Appid == appid).Select(x => x.ConnectionId ?? "").ToList();
|
||||
if (connectionIds != null && connectionIds.Any())
|
||||
{
|
||||
var clients = Clients.Clients(connectionIds);
|
||||
var count = await notificationDomain.GetMessageCount(dto.Eid);
|
||||
await clients.SendAsync(dto.Method, dto.Message, dto.Id == null ? notification.ID : dto.Id, count);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task LoginUser(string userInfo)
|
||||
{
|
||||
var user = JsonSerializer.Deserialize<OnlineUserInfoDto>(userInfo);
|
||||
if (user == null || user.Eid == 5004) return;
|
||||
user.LoginTime = DateTime.Now;
|
||||
var list = await GetList();
|
||||
if (list.Any(x => x.Eid == user.Eid && x.Ip != user.Ip) && !user.Freelogin)
|
||||
{
|
||||
var downlineUsers = list.Where(x => x.Eid == user.Eid && x.Ip != user.Ip).ToList();
|
||||
foreach (var downlineUser in downlineUsers)
|
||||
{
|
||||
await ForcedDownline(downlineUser, "您的账号已在其他电脑登录,如非本人操作,请修改密码!");
|
||||
list.Remove(downlineUser);
|
||||
}
|
||||
}
|
||||
list.Add(user);
|
||||
await _redisManager.SetAsync(CacheKeys.UserListKey, list, TimeSpan.FromDays(1));
|
||||
await SendUserMessage(user);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 强制下线
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ForcedDownline(OnlineUserInfoDto user, string? message)
|
||||
{
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var cacheDomain = scope.ServiceProvider.GetRequiredService<ICacheDomain>();
|
||||
var enabled = await cacheDomain.GetValueParameter(ParameterEnums.CRM_CORE_FORCED_DOWNLINE_ENABLED);
|
||||
if (!string.IsNullOrEmpty(user.ConnectionId) && enabled == "1")
|
||||
{
|
||||
var client = Clients.Client(user.ConnectionId);
|
||||
await client.SendAsync("ForcedDownline", message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SendUserMessage(OnlineUserInfoDto user)
|
||||
{
|
||||
using IServiceScope scope = _serviceProvider.CreateScope();
|
||||
var cacheDomain = scope.ServiceProvider.GetRequiredService<ICacheDomain>();
|
||||
var enabled = await cacheDomain.GetValueParameter(ParameterEnums.CRM_CORE_NOTIFICATION_ENABLED);
|
||||
var notificationDomain = scope.ServiceProvider.GetRequiredService<INotificationDomain>();
|
||||
var notifications = await notificationDomain.GetNotificationsByEid(user.Eid, user.Appid);
|
||||
if (notifications != null && notifications.Any() && !string.IsNullOrEmpty(user.ConnectionId) && enabled == "1")
|
||||
{
|
||||
var client = Clients.Client(user.ConnectionId);
|
||||
foreach (var notification in notifications)
|
||||
{
|
||||
Log.Information(notification.ToJson());
|
||||
var count = await notificationDomain.GetMessageCount(user.Eid, notification.NotificationType);
|
||||
await client.SendAsync(notification?.NotificationType?.ToString() ?? "ReceiveMessage", notification.Message, notification.Id, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task OnDisconnectedAsync(Exception? exception)
|
||||
{
|
||||
var connectionId = Context.ConnectionId;
|
||||
var list = await GetList();
|
||||
var user = list.Where(x => x.ConnectionId == connectionId).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
list.Remove(user);
|
||||
await _redisManager.SetAsync(CacheKeys.UserListKey, list, TimeSpan.FromDays(1));
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<List<OnlineUserInfoDto>> GetList()
|
||||
=> await _redisManager.ExistsAsync(CacheKeys.UserListKey) ?
|
||||
await _redisManager.GetListAsync<OnlineUserInfoDto>(CacheKeys.UserListKey) :
|
||||
new List<OnlineUserInfoDto>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
using Crm.Core.Domain.Dto.Customer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Crm.Core.Domain.Config.SystemEnums;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface ICacheDomain : ITransientDependency
|
||||
{
|
||||
Task<string> GetValueParameter(string key);
|
||||
|
||||
Task<string> GetValueParameter(ParameterEnums key);
|
||||
|
||||
Task<T> GetParameter<T>(string key) where T : new();
|
||||
|
||||
Task<T> GetParameter<T>(ParameterEnums key) where T : new();
|
||||
|
||||
Task<bool> SetApp(IOracleRepository<CrmDbContext> repository, decimal deptmentId);
|
||||
|
||||
Task<bool> SetApp(IOracleRepository<CrmDbContext> repository, string appid);
|
||||
|
||||
Task<List<decimal>> GetDeptmentIdByApp(string app);
|
||||
|
||||
Task<string> GetAppidByDeptmentId(decimal deptmentId);
|
||||
|
||||
Task<List<decimal>> GetDeptmentIds();
|
||||
Task<List<decimal>> GetSpecialDeptmentIdsByRightCode(string rightcode);
|
||||
|
||||
Task<List<SalesDeptDto>> GetSalesDeptList();
|
||||
|
||||
Task<decimal> GetCurrentEid();
|
||||
|
||||
Task<List<decimal>> GetDeptmentIdsByEid(decimal eid);
|
||||
|
||||
Task<List<decimal>> GetEidsByDeptmentIds(GroupOrDeptIdDto deptStr);
|
||||
|
||||
Task<BusinessLineInfo> GetBusinessLineByDeptMentIds(GroupOrDeptIdDto dto);
|
||||
|
||||
Task<RoleLevel> LevelSSO(decimal eid);
|
||||
|
||||
Task<List<decimal>> GetSalesDeptsForEid(decimal eid);
|
||||
|
||||
Task<List<DeptmentDto>> GetDeptments();
|
||||
|
||||
void GetAllDeptIDOrGidByDeptStr(string deptstr, ref List<decimal> ALLdeptIDS, ref List<decimal> ALLgidS);
|
||||
|
||||
string GetApp();
|
||||
|
||||
Task<List<decimal>> GetLeadEid(decimal deptid, decimal eid);
|
||||
|
||||
Task<List<UserDeptNameInfo>> GetUserInfoByEIds(string eids);
|
||||
|
||||
Task<bool> SynchronousCustomer(SynchronousCustomerDto dto);
|
||||
|
||||
Task<decimal> GetSeq_smallid_get(decimal deptid);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using Crm.Core.Domain.Dto.CRM;
|
||||
using Crm.Core.Domain.Dto.Customer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface ICustomerDomain : IScopedDependency
|
||||
{
|
||||
Task<List<SalesLeadDto>> GetSalesLeadList(string encyptDto);
|
||||
Task<bool> BestCustomerCreate(BestCustomerDto dto);
|
||||
Task<List<WwHhuserEidDto>> GetWwHhuserEids(List<decimal> eids, int deptid);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
using Crm.Core.Domain.Dto.Live;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface ILiveDomain : IScopedDependency
|
||||
{
|
||||
Task<LivePageDto<LiveUserSummayDataDto>> GetLiveUserSummayPageDto(LiveSearchUserSummayPageDto dto);
|
||||
|
||||
Task<LivePageDto<LiveUserRealTimeDataDto>> GetLiveUserRealTimePageDto(LiveSearchUserRealTimePageDto dto);
|
||||
|
||||
Task<LivePageDto<LiveUserWeworkDataDto>> GetLiveUserWeworkPageDto(LiveSearchUserWeworkPageDto dto);
|
||||
|
||||
Task<List<LiveCourseProductsDto>> GetLiveCourseProduct(LiveSearchCourseProductsDto dto);
|
||||
|
||||
Task<LiveUserStatDto> GetLiveUserStat(LiveSearchUserSummayPageDto dto);
|
||||
|
||||
Task<LiveWeworkStatDto> GetLiveWeworkStat(LiveSearchUserWeworkPageDto dto);
|
||||
|
||||
Task<LivePlaybackPageDto<LivePlaybackDetailDto, LivePlaybackDetailStatDto>> GetLivePlaybackDetailPageDto(LivePlaybackDetailPageDto dto);
|
||||
|
||||
Task<LivePlaybackPageDto<LivePlaybackSummayDto, LivePlaybackSummayStatDto>> GetLivePlaybackSummayPageDto(LivePlaybackSummayPageDto dto);
|
||||
|
||||
Task<List<CourseDto>> GetCourses(decimal? deptid);
|
||||
|
||||
Task<dynamic> GetDeptMent();
|
||||
|
||||
Task<dynamic> GetBusinessLine();
|
||||
|
||||
Task<dynamic> GetInnerusers(int? groupid);
|
||||
|
||||
Task<List<LiveCourseSummaryDto>> GetLiveCourseSummary(LiveSearchCourseSummaryDto dto);
|
||||
|
||||
Task<List<LiveScheduleDto>> GetLiveScheduleTree(decimal? deptid);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using Crm.Core.Domain.Dto.CRM;
|
||||
using Crm.Core.Entity.Crm;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface INotificationDomain : ITransientDependency
|
||||
{
|
||||
Task<BAS_NOTIFICATION> InsetNotification(OrderUserProtectionDto orderUserProtectionDto, string message);
|
||||
|
||||
Task<BAS_NOTIFICATION> InsetNotification(SendMessageDto dto);
|
||||
|
||||
Task InsetNotificationStatistics(OrderUserProtectionDto orderUserProtectionDto);
|
||||
|
||||
Task<List<NotificationDto>> GetNotificationsByEid(decimal eid, string appid);
|
||||
|
||||
Task<PageResult<NotificationDto>> GetNotificationsPage(NotificationSearchPageDto search);
|
||||
|
||||
Task<bool> Read(List<decimal> messageIds);
|
||||
|
||||
Task<bool> RealAll();
|
||||
|
||||
Task<LivePageDto<NotificationStatisticsDto>> GetNotificationStatisticsPage(NotificationStatisticsSearchPageDto dto);
|
||||
|
||||
Task<int> GetMessageCount(decimal? eid, NotificationType? notificationType = null, string? connectionId = "");
|
||||
|
||||
Task WeworkSend(string? appid, string? appuserid, decimal eid, string message);
|
||||
|
||||
Task SendMessage(SendMessageDto dto);
|
||||
Task<RepeatDeptmentDto> GetRepeatDeptments();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using Crm.Core.Domain.Dto.Order;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface IOrderDomain : IScopedDependency
|
||||
{
|
||||
Task UpdateOrderRealName(UpdateOrderRealNameDto dto);
|
||||
|
||||
Task<CreateOrderInfo> GetCreateOrderSelectItem(GetCreateOrderQueryDto dto);
|
||||
|
||||
Task<ProductDetail> GetProductDetail(ProductQueryDto dto);
|
||||
|
||||
Task<List<ProductInfo>> GetProductByMinType(ProductQueryByMinProductId dto);
|
||||
|
||||
Task<bool> CreateOrder(CreateOrderDto dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface IUserDomain : IScopedDependency
|
||||
{
|
||||
Task<CrmUserDto> GetCrmUser(int eid);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Impl
|
||||
{
|
||||
public interface IUserInfoDomain : IScopedDependency
|
||||
{
|
||||
Task<List<UserInfoReq>> GetUserInfoByApi(string? appid, string? userid);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,409 @@
|
|||
using Crm.Core.Domain.Dto.Live;
|
||||
using Crm.Core.Domain.Dto.LivePlayback;
|
||||
using Crm.Core.Domain.Impl;
|
||||
using Crm.Core.Entity.Crm;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Crm.Core.Domain.Config.SystemEnums;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
internal class LiveDomain : ILiveDomain
|
||||
{
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IOracleRepository<CrmDbContext> _repository;
|
||||
private readonly ICacheDomain _cacheDomain;
|
||||
private readonly SystemConfig _systemConfig;
|
||||
|
||||
public LiveDomain(IHttpClient httpClient,
|
||||
IConfiguration configuration,
|
||||
ICacheDomain cacheDomain,
|
||||
IOracleRepository<CrmDbContext> repository)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
_configuration = configuration;
|
||||
_cacheDomain = cacheDomain;
|
||||
_systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
public async Task<LivePageDto<LiveUserSummayDataDto>> GetLiveUserSummayPageDto(LiveSearchUserSummayPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LivePageDto<LiveUserSummayDataDto>();
|
||||
return await GetLive<LivePageDto<LiveUserSummayDataDto>, LiveSearchUserSummayPageDto>(_systemConfig.GetLiveSummaryUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LivePageDto<LiveUserRealTimeDataDto>> GetLiveUserRealTimePageDto(LiveSearchUserRealTimePageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LivePageDto<LiveUserRealTimeDataDto>();
|
||||
return await GetLive<LivePageDto<LiveUserRealTimeDataDto>, LiveSearchUserRealTimePageDto>(_systemConfig.GetLiveRealtimeUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LivePageDto<LiveUserWeworkDataDto>> GetLiveUserWeworkPageDto(LiveSearchUserWeworkPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LivePageDto<LiveUserWeworkDataDto>();
|
||||
return await GetLive<LivePageDto<LiveUserWeworkDataDto>, LiveSearchUserWeworkPageDto>(_systemConfig.GetLiveWeworkUsersUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LiveUserStatDto> GetLiveUserStat(LiveSearchUserSummayPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LiveUserStatDto();
|
||||
return await GetLive<LiveUserStatDto, LiveSearchUserSummayPageDto>(_systemConfig.GetLiveUserStatUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LiveWeworkStatDto> GetLiveWeworkStat(LiveSearchUserWeworkPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LiveWeworkStatDto();
|
||||
return await GetLive<LiveWeworkStatDto, LiveSearchUserWeworkPageDto>(_systemConfig.GetLiveWeworkStatUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LivePlaybackPageDto<LivePlaybackDetailDto, LivePlaybackDetailStatDto>> GetLivePlaybackDetailPageDto(LivePlaybackDetailPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LivePlaybackPageDto<LivePlaybackDetailDto, LivePlaybackDetailStatDto>();
|
||||
if (string.IsNullOrEmpty(dto.ActDateFrom))
|
||||
{
|
||||
throw new ApiException("请选择回放日期开始日期!");
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(dto.ActDateTo))
|
||||
{
|
||||
var day = DiffDay(dto.ActDateFrom, dto.ActDateTo);
|
||||
if (day > 31)
|
||||
{
|
||||
throw new ApiException("回放日期选择不能超过一个月,请重新选择!");
|
||||
}
|
||||
}
|
||||
return await GetLive<LivePlaybackPageDto<LivePlaybackDetailDto, LivePlaybackDetailStatDto>, LivePlaybackDetailPageDto>(_systemConfig.GetLivePlaybackDetailUrl(), dto);
|
||||
}
|
||||
|
||||
public async Task<LivePlaybackPageDto<LivePlaybackSummayDto, LivePlaybackSummayStatDto>> GetLivePlaybackSummayPageDto(LivePlaybackSummayPageDto dto)
|
||||
{
|
||||
if (dto.Deptid == 0) return new LivePlaybackPageDto<LivePlaybackSummayDto, LivePlaybackSummayStatDto>();
|
||||
if (string.IsNullOrEmpty(dto.ActDateFrom))
|
||||
{
|
||||
throw new ApiException("请选择回放日期开始日期!");
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(dto.ActDateTo))
|
||||
{
|
||||
var day = DiffDay(dto.ActDateFrom, dto.ActDateTo);
|
||||
if (day > 31)
|
||||
{
|
||||
throw new ApiException("回放日期选择不能超过一个月,请重新选择!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var day = DiffDay(dto.ActDateFrom, DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
if (day > 31)
|
||||
{
|
||||
throw new ApiException("回放日期选择不能超过一个月,请重新选择!");
|
||||
}
|
||||
}
|
||||
return await GetLive<LivePlaybackPageDto<LivePlaybackSummayDto, LivePlaybackSummayStatDto>, LivePlaybackSummayPageDto>(_systemConfig.GetLivePlaybackSummaryUrl(), dto);
|
||||
}
|
||||
|
||||
private async Task<T> GetLive<T, D>(string url, D dto)
|
||||
where T : new()
|
||||
where D : LiveSearchPageDto
|
||||
{
|
||||
if (dto.ExcludeDeptid == null)
|
||||
{
|
||||
var deptmentIds = await _cacheDomain.GetDeptmentIds();
|
||||
var deptmentIds2= await _cacheDomain.GetSpecialDeptmentIdsByRightCode("G373");
|
||||
deptmentIds.AddRange(deptmentIds2);
|
||||
if (deptmentIds == null || !deptmentIds.Any() )
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
|
||||
dto.Deptids = string.Join(",", deptmentIds);
|
||||
}
|
||||
if (typeof(D) != typeof(LivePlaybackDetailPageDto) && typeof(D) != typeof(LivePlaybackSummayPageDto) && string.IsNullOrEmpty(dto.LivingDateFrom))
|
||||
{
|
||||
throw new ApiException("请选择直播日期开始日期!");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(dto.LivingDateFrom))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(dto.LivingDateTo))
|
||||
{
|
||||
var day = DiffDay(dto.LivingDateFrom, dto.LivingDateTo);
|
||||
if (day > 31)
|
||||
{
|
||||
throw new ApiException("直播日期选择不能超过一个月,请重新选择!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var day = DiffDay(dto.LivingDateFrom, DateTime.Now.ToString("yyyy-MM-dd"));
|
||||
if (day > 31)
|
||||
{
|
||||
throw new ApiException("直播日期选择不能超过一个月,请重新选择!");
|
||||
}
|
||||
}
|
||||
}
|
||||
var eid = await _cacheDomain.GetCurrentEid();
|
||||
Log.Information($"{url} 查询事业部:{dto.Deptids}");
|
||||
// 处理筛选的事业部
|
||||
if (!string.IsNullOrEmpty(dto.Txt_groupIds) && decimal.TryParse(dto.Txt_groupIds, out decimal salesGroupId))
|
||||
{
|
||||
var sales = await _cacheDomain.GetSalesDeptList();
|
||||
if (!sales.Any(x => x.SalesGroupId == salesGroupId))
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
dto.GroupIds = string.Join(",", sales.First(x => x.SalesGroupId == salesGroupId).GroupIds);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(dto.Txt_deptId))
|
||||
{
|
||||
var sales = await _cacheDomain.GetSalesDeptList();
|
||||
var selesDepts = dto.Txt_deptId.Split(",");
|
||||
var selesDeptIds = new List<decimal>();
|
||||
foreach (var selesDept in selesDepts)
|
||||
{
|
||||
if (decimal.TryParse(selesDept, out decimal salesDeptId))
|
||||
{
|
||||
if (!sales.Any(x => x.SalesGroupId == salesDeptId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
selesDeptIds.Add(salesDeptId);
|
||||
}
|
||||
}
|
||||
var groupIds = new List<decimal>();
|
||||
sales.Where(x => x.SalesGroupId.HasValue && selesDeptIds.Contains(x.SalesGroupId.Value)).ToList().ForEach(x => groupIds.AddRange(x.GroupIds));
|
||||
dto.GroupIds = string.Join(",", groupIds);
|
||||
if (string.IsNullOrEmpty(dto.GroupIds))
|
||||
{
|
||||
var businessLineInfo = await _cacheDomain.GetBusinessLineByDeptMentIds(new Dto.Customer.GroupOrDeptIdDto { DeptId = dto.Txt_deptId });
|
||||
dto.Deptids = businessLineInfo.deptId.ToString();
|
||||
}
|
||||
}
|
||||
// 处理筛选员工ID
|
||||
if (dto.Eid != null && dto.UserId != null && dto.Eid != dto.UserId)
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
if (dto.Eid != null && dto.UserId == null)
|
||||
{
|
||||
var level = await _cacheDomain.LevelSSO(eid);
|
||||
switch (level)
|
||||
{
|
||||
case RoleLevel.Self:
|
||||
if (dto.Eid != eid) return new T();
|
||||
break;
|
||||
|
||||
case RoleLevel.Dept:
|
||||
var eids = await _cacheDomain.GetSalesDeptsForEid(eid);
|
||||
if (!eids.Contains(dto.Eid.Value)) return new T();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
dto.Eid = dto.UserId == null ? dto.Eid : dto.UserId;
|
||||
|
||||
var dtoStr = JsonSerializer.Serialize(dto);
|
||||
var param = JsonSerializer.Deserialize<Dictionary<string, object>>(dtoStr);
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetAsync<ApiResult<T>>($"{url}", param);
|
||||
if (response.Code == 0)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{url} 请求出错,param: {dtoStr}");
|
||||
throw new ApiException("大数据接口请求报错!");
|
||||
}
|
||||
return new T();
|
||||
}
|
||||
|
||||
private static int DiffDay(string dt1, string dt2)
|
||||
{
|
||||
var d1 = DateTime.Parse(dt1);
|
||||
var d2 = DateTime.Parse(dt2);
|
||||
var ts = d2 - d1;
|
||||
return (int)ts.TotalDays;
|
||||
}
|
||||
|
||||
public async Task<List<CourseDto>> GetCourses(decimal? deptid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (deptid == 0)
|
||||
{
|
||||
return new List<CourseDto>();
|
||||
}
|
||||
var list = new List<CourseDto>();
|
||||
var deptmentIds = await _cacheDomain.GetDeptmentIds();
|
||||
var deptmentIds2 = await _cacheDomain.GetSpecialDeptmentIdsByRightCode("G373");
|
||||
deptmentIds.AddRange(deptmentIds2);
|
||||
|
||||
var deptments = await _cacheDomain.GetDeptments();
|
||||
deptmentIds = deptmentIds.AsEnumerable().If(deptid != null, x => x.Where(x => x == deptid)).ToList();
|
||||
Log.Information($"deptmentIds:" + JsonHelper.ToJson(deptmentIds));
|
||||
foreach (var deptmentId in deptmentIds)
|
||||
{
|
||||
var response = await _httpClient.GetAsync<RetResult<List<CourseDto>>>($"{_systemConfig.GetCourseUrl()}?deptid={deptmentId}");
|
||||
if (response.Ret == 0)
|
||||
{
|
||||
var deptment = deptments.FirstOrDefault(x => x.Id == deptmentId);
|
||||
foreach (var item in response.Data)
|
||||
{
|
||||
item.DepartmentId = (int)deptmentId;
|
||||
item.Title = deptment == null ? item.Title : $"{item.Title}({deptment.Title},ID:{item.Id})";
|
||||
item.Deptname = deptment?.Title;
|
||||
item.CourseName = item.Title;
|
||||
}
|
||||
list.AddRange(response.Data);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"获取课程接口报错:{response.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{_systemConfig.GetCourseUrl()} 请求出错");
|
||||
throw new ApiException("获取课程接口报错!");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<dynamic> GetDeptMent()
|
||||
{
|
||||
var groups = await _repository.GetRepository<BAS_INNERGROUP>().Query()
|
||||
.Where(x => x.DEPARTMENT_ID != null)
|
||||
.Select(x => new
|
||||
{
|
||||
id = x.DEPARTMENT_ID,
|
||||
title = x.GNAME
|
||||
}).ToListAsync();
|
||||
return groups;
|
||||
}
|
||||
|
||||
public async Task<dynamic> GetBusinessLine()
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetAsync<RetResult<dynamic>>(_systemConfig.GetBusinessLineUrl());
|
||||
if (response.Ret == 0)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"获取业务线接口报错:{response.Message}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{_systemConfig.GetDeptMentUrl()} 请求出错");
|
||||
throw new ApiException("获取业务线接口报错!");
|
||||
}
|
||||
return new Dictionary<int, string>();
|
||||
}
|
||||
|
||||
public async Task<dynamic> GetInnerusers(int? groupid)
|
||||
{
|
||||
if (groupid == null)
|
||||
{
|
||||
return new List<dynamic>();
|
||||
}
|
||||
var users = await _repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Include(x => x.BAS_INNERUSERGROUP)
|
||||
.Include(x => x.BAS_INNERUSERGROUP.BAS_INNERGROUP)
|
||||
.Where(x => x.BAS_INNERUSERGROUP.BAS_INNERGROUP.DEPARTMENT_ID == groupid)
|
||||
.Select(x => new
|
||||
{
|
||||
id = x.EID,
|
||||
title = $"{x.UNAME}-{x.EID}"
|
||||
})
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
return users;
|
||||
}
|
||||
|
||||
public async Task<List<LiveCourseSummaryDto>> GetLiveCourseSummary(LiveSearchCourseSummaryDto dto)
|
||||
{
|
||||
var dtoStr = JsonSerializer.Serialize(dto);
|
||||
var param = JsonSerializer.Deserialize<Dictionary<string, object>>(dtoStr);
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetAsync<ApiResult<List<LiveCourseSummaryDto>>>($"{_systemConfig.GetLiveCourseSummaryUrl()}", param);
|
||||
if (response.Code == 0)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{_systemConfig.GetLiveUserStatUrl()} 请求出错,param: {dtoStr}");
|
||||
throw new ApiException("大数据接口请求报错!");
|
||||
}
|
||||
return new List<LiveCourseSummaryDto>();
|
||||
}
|
||||
|
||||
public async Task<List<LiveCourseProductsDto>> GetLiveCourseProduct(LiveSearchCourseProductsDto dto)
|
||||
{
|
||||
try
|
||||
{
|
||||
dto.Deptids = String.Join(",", await _cacheDomain.GetDeptmentIds());
|
||||
var dtoStr = JsonSerializer.Serialize(dto);
|
||||
var param = JsonSerializer.Deserialize<Dictionary<string, object>>(dtoStr);
|
||||
var t = _systemConfig.GetProductsUrl();
|
||||
var response = await _httpClient.GetAsync<RetResult<List<LiveCourseProductsDto>>>(_systemConfig.GetProductsUrl(), param);
|
||||
if (response.Ret == 0)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"获取业务线接口报错:{response.Message}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{_systemConfig.GetDeptMentUrl()} 请求出错");
|
||||
throw new ApiException("获取业务线接口报错!");
|
||||
}
|
||||
return new List<LiveCourseProductsDto>();
|
||||
}
|
||||
|
||||
public async Task<List<LiveScheduleDto>> GetLiveScheduleTree(decimal? deptid)
|
||||
{
|
||||
var courses = await GetCourses(deptid);
|
||||
var schedules = new List<LiveScheduleDto>();
|
||||
foreach (var dept in courses.Select(x => new { x.Deptname, x.DepartmentId }).Distinct())
|
||||
{
|
||||
schedules.Add(new LiveScheduleDto
|
||||
{
|
||||
Deptid = dept.DepartmentId,
|
||||
Value = dept.DepartmentId,
|
||||
Name = dept.Deptname,
|
||||
Children = new List<LiveScheduleDto>()
|
||||
});
|
||||
}
|
||||
foreach (var course in courses)
|
||||
{
|
||||
var schedule = schedules.Find(x => x.Deptid == course.DepartmentId);
|
||||
schedule.Children.Add(new LiveScheduleDto
|
||||
{
|
||||
Deptid = course.DepartmentId,
|
||||
Value = course.Id,
|
||||
Name = course.Title
|
||||
});
|
||||
}
|
||||
return schedules;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,678 @@
|
|||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using Crm.Core.Domain.Dto.CRM;
|
||||
using Crm.Core.Domain.Dto.Zxd;
|
||||
using Crm.Core.Domain.Impl;
|
||||
using Crm.Core.Entity.Crm;
|
||||
using DG.Core;
|
||||
using static Crm.Core.Domain.Config.SystemEnums;
|
||||
using static DG.Oracle.EntityFramework.Enums;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
public class NotificationDomain : INotificationDomain
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IRedisManager _redisManager;
|
||||
private readonly IOracleRepository<CrmDbContext> _repository;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ICacheDomain _cacheDomain;
|
||||
private readonly SystemConfig _systemConfig;
|
||||
private readonly WeworkConfig _weworkConfig;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly NotificationHub _notificationHub;
|
||||
|
||||
public NotificationDomain(IOracleRepository<CrmDbContext> repository,
|
||||
IRedisManager redisManager,
|
||||
IMapper mapper,
|
||||
IHttpClient httpClient,
|
||||
IConfiguration configuration,
|
||||
ICacheDomain cacheDomain,
|
||||
IServiceProvider serviceProvider,
|
||||
NotificationHub notificationHub)
|
||||
{
|
||||
_repository = repository;
|
||||
_redisManager = redisManager;
|
||||
_mapper = mapper;
|
||||
_httpClient = httpClient;
|
||||
_configuration = configuration;
|
||||
_cacheDomain = cacheDomain;
|
||||
_systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
_weworkConfig = _configuration.GetSection("WeworkConfig").Get<WeworkConfig>();
|
||||
_serviceProvider = serviceProvider;
|
||||
_notificationHub = notificationHub;
|
||||
}
|
||||
|
||||
public async Task<BAS_NOTIFICATION> InsetNotification(OrderUserProtectionDto orderUserProtectionDto, string message)
|
||||
{
|
||||
try
|
||||
{
|
||||
var deptments = await _cacheDomain.GetDeptments();
|
||||
if (deptments == null || !deptments.Any())
|
||||
{
|
||||
Log.Error($"无法获取事业部列表!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
decimal? repeatDeptid = orderUserProtectionDto.repeat_deptid;
|
||||
if (!repeatDeptid.HasValue ||
|
||||
!deptments.Any(x => x.Id == repeatDeptid) ||
|
||||
!await _cacheDomain.SetApp(_repository, repeatDeptid.Value))
|
||||
{
|
||||
Log.Error($"【{orderUserProtectionDto.repeat_deptid}】 非法的deptmentId,无法切换app!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
|
||||
var id = await _repository.GetSeqAsync(PKIDType.LargeTable);
|
||||
decimal eid = orderUserProtectionDto.repeat_eid ?? 0;
|
||||
|
||||
using (var transaction = await _repository.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
var notification = new BAS_NOTIFICATION()
|
||||
{
|
||||
ID = id,
|
||||
MESSAGE = message,
|
||||
EID = eid,
|
||||
RESID = orderUserProtectionDto.resid,
|
||||
UMID = orderUserProtectionDto.umid,
|
||||
NOTIFICATIONID = orderUserProtectionDto.id,
|
||||
CTIME = DateTime.Now,
|
||||
READ = 0,
|
||||
NOTIFICATIONTYPE = NotificationType.ReceiveMessage
|
||||
};
|
||||
await _repository.GetRepository<BAS_NOTIFICATION>().InsertAsync(notification);
|
||||
// 推送企微消息
|
||||
var corp = await _repository.GetRepository<WW_CORP_APP>().Query().FirstOrDefaultAsync(x => x.CORPID == orderUserProtectionDto.repeat_appid);
|
||||
var click = $"<a href='https://inapp.hc.dn8188.com/Wework/openchat.html?appid={orderUserProtectionDto.repeat_appid}&userid={orderUserProtectionDto.repeat_appuserid}&agentid={corp?.APPID}&appuserid={orderUserProtectionDto.repeat_appuserid}'>点击查看</a>";
|
||||
await WeworkSend(orderUserProtectionDto.repeat_appid, orderUserProtectionDto.repeat_appuserid, eid, message + click);
|
||||
|
||||
await transaction.CommitAsync();
|
||||
|
||||
return notification;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await transaction.RollbackAsync();
|
||||
transaction.Dispose();
|
||||
Log.Error(ex, "插入消息报错!");
|
||||
}
|
||||
}
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"处理消息报错,data: {JsonSerializer.Serialize(orderUserProtectionDto)}!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<BAS_NOTIFICATION> InsetNotification(SendMessageDto dto)
|
||||
{
|
||||
try
|
||||
{
|
||||
var deptments = await _cacheDomain.GetDeptments();
|
||||
if (deptments == null || !deptments.Any())
|
||||
{
|
||||
Log.Error($"无法获取事业部列表!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
if (!deptments.Any(x => x.Id == dto.Deptid) ||
|
||||
!await _cacheDomain.SetApp(_repository, dto.Deptid ?? 0))
|
||||
{
|
||||
Log.Error($"【{dto.Deptid}】 非法的deptmentId,无法切换app!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
|
||||
var id = await _repository.GetSeqAsync(PKIDType.LargeTable);
|
||||
var eid = dto.Eid;
|
||||
|
||||
using (var transaction = await _repository.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
var notification = new BAS_NOTIFICATION()
|
||||
{
|
||||
ID = id,
|
||||
MESSAGE = dto.Message,
|
||||
EID = eid,
|
||||
RESID = dto.Resid,
|
||||
UMID = dto.Umid,
|
||||
NOTIFICATIONID = Guid.NewGuid().ToString(),
|
||||
CTIME = DateTime.Now,
|
||||
READ = 0,
|
||||
NOTIFICATIONTYPE = dto.Method == NotificationType.HgRefundMessage.ToString() ? NotificationType.HgRefundMessage :
|
||||
dto.Method == NotificationType.ComplaintMessage.ToString() ? NotificationType.ComplaintMessage :
|
||||
string.IsNullOrEmpty(dto.Umid) ? NotificationType.MsgToolMessage : NotificationType.ReceiveMessage
|
||||
};
|
||||
await _repository.GetRepository<BAS_NOTIFICATION>().InsertAsync(notification);
|
||||
|
||||
await transaction.CommitAsync();
|
||||
|
||||
return notification;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await transaction.RollbackAsync();
|
||||
transaction.Dispose();
|
||||
Log.Error(ex, "插入消息报错!");
|
||||
}
|
||||
}
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"处理消息报错,data: {JsonSerializer.Serialize(dto)}!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InsetNotificationStatistics(OrderUserProtectionDto orderUserProtectionDto)
|
||||
{
|
||||
var deptments = await _cacheDomain.GetDeptments();
|
||||
if (deptments == null || !deptments.Any())
|
||||
{
|
||||
Log.Error($"无法获取事业部列表!");
|
||||
return;
|
||||
}
|
||||
if (!deptments.Any(x => x.Id == orderUserProtectionDto.deptid) ||
|
||||
!await _cacheDomain.SetApp(_repository, orderUserProtectionDto.deptid))
|
||||
{
|
||||
Log.Error($"【{orderUserProtectionDto.deptid}】 非法的deptmentId,无法切换app!");
|
||||
return;
|
||||
}
|
||||
var statistics = new BAS_NOTIFICATION_STATISTICS()
|
||||
{
|
||||
ID = orderUserProtectionDto.id,
|
||||
DEPTID = orderUserProtectionDto.deptid,
|
||||
CHANNEL = orderUserProtectionDto.channel,
|
||||
DEPTNAME = orderUserProtectionDto.deptname,
|
||||
CROSSDEPT = orderUserProtectionDto.deptid == orderUserProtectionDto.repeat_deptid ? 0 : 1,
|
||||
EID = orderUserProtectionDto.eid ?? 0,
|
||||
ENDTIME = orderUserProtectionDto.end_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.end_time.Value.ToString()),
|
||||
ENAME = orderUserProtectionDto.ename,
|
||||
CTIME = DateTime.Now,
|
||||
REPEATDAYS = orderUserProtectionDto.repeat_days,
|
||||
REPEATSTARTTIME = orderUserProtectionDto.repeat_start_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.repeat_start_time.Value.ToString()),
|
||||
REPEATDEPTID = orderUserProtectionDto.repeat_deptid,
|
||||
REPEATDEPTNAME = orderUserProtectionDto.repeat_deptname,
|
||||
REPEATEID = orderUserProtectionDto.repeat_eid,
|
||||
REPEATENDTIME = orderUserProtectionDto.repeat_end_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.repeat_end_time.Value.ToString()),
|
||||
RESID = orderUserProtectionDto.resid,
|
||||
NAME = orderUserProtectionDto.name,
|
||||
REPEATENAME = orderUserProtectionDto.repeat_ename,
|
||||
REPEATTYPE = orderUserProtectionDto.repeat_type
|
||||
};
|
||||
await _repository.GetRepository<BAS_NOTIFICATION_STATISTICS>().InsertAsync(statistics);
|
||||
|
||||
// 切换数据库
|
||||
decimal? repeatDeptid = orderUserProtectionDto.repeat_deptid;
|
||||
if (!repeatDeptid.HasValue ||
|
||||
!deptments.Any(x => x.Id == repeatDeptid) ||
|
||||
!await _cacheDomain.SetApp(_repository, repeatDeptid.Value))
|
||||
{
|
||||
Log.Error($"【{orderUserProtectionDto.repeat_deptid}】 非法的repeat_deptid,无法切换app!");
|
||||
return;
|
||||
}
|
||||
statistics = new BAS_NOTIFICATION_STATISTICS()
|
||||
{
|
||||
ID = orderUserProtectionDto.id,
|
||||
DEPTID = orderUserProtectionDto.deptid,
|
||||
CHANNEL = orderUserProtectionDto.channel,
|
||||
DEPTNAME = orderUserProtectionDto.deptname,
|
||||
CROSSDEPT = orderUserProtectionDto.deptid == orderUserProtectionDto.repeat_deptid ? 0 : 1,
|
||||
EID = orderUserProtectionDto.eid ?? 0,
|
||||
ENDTIME = orderUserProtectionDto.end_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.end_time.Value.ToString()),
|
||||
ENAME = orderUserProtectionDto.ename,
|
||||
CTIME = DateTime.Now,
|
||||
REPEATDAYS = orderUserProtectionDto.repeat_days,
|
||||
REPEATSTARTTIME = orderUserProtectionDto.repeat_start_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.repeat_start_time.Value.ToString()),
|
||||
REPEATDEPTID = orderUserProtectionDto.repeat_deptid,
|
||||
REPEATDEPTNAME = orderUserProtectionDto.repeat_deptname,
|
||||
REPEATEID = orderUserProtectionDto.repeat_eid,
|
||||
REPEATENDTIME = orderUserProtectionDto.repeat_end_time == null ? default(DateTime?) : Utility.ConvertStringToDateTime(orderUserProtectionDto.repeat_end_time.Value.ToString()),
|
||||
RESID = orderUserProtectionDto.resid,
|
||||
NAME = orderUserProtectionDto.name,
|
||||
REPEATENAME = orderUserProtectionDto.repeat_ename,
|
||||
REPEATTYPE = orderUserProtectionDto.repeat_type
|
||||
};
|
||||
await _repository.GetRepository<BAS_NOTIFICATION_STATISTICS>().InsertAsync(statistics);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 推送企微消息
|
||||
/// </summary>
|
||||
/// <param name="appid"></param>
|
||||
/// <param name="appuserid"></param>
|
||||
/// <param name="eid"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task WeworkSend(string? appid, string? appuserid, decimal eid, string message)
|
||||
{
|
||||
if (string.IsNullOrEmpty(appid) && string.IsNullOrEmpty(appuserid)) return;
|
||||
// 六合投研服务中心或懂牛投研服务中心不发信息
|
||||
var deptidList = new int[] { 40, 41 };
|
||||
var url = _systemConfig.GetDeptNameByEid(eid.ToString());
|
||||
var result = await _httpClient.GetAsync<ApiResult<List<DeptMentDto>>>(url);
|
||||
if (result.Code == 0)
|
||||
{
|
||||
var deptids = result.Data.Where(x => x.DeptId.HasValue).Select(x => x.DeptId.Value).ToList();
|
||||
if (deptidList.Intersect(deptids).Any())
|
||||
{
|
||||
Log.Information($"{eid} 六合投研服务中心或懂牛投研服务中心不发信息");
|
||||
return;
|
||||
}
|
||||
}
|
||||
var list = await _repository.GetRepository<WW_HHUSER_EID>()
|
||||
.QueryIncluding(x => x.WW_CORP_APP)
|
||||
.Where(x => x.EID == eid)
|
||||
.ToListAsync();
|
||||
|
||||
var clientid = "UPWEBSITE";
|
||||
var param = new
|
||||
{
|
||||
Account = "dn.uc",
|
||||
Password = "dn.uc.password",
|
||||
Time = SignHelper.GetTimeStamp()
|
||||
};
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.WW_CORP_APP == null) continue;
|
||||
if (item.WW_CORP_APP.CORPID != appid || item.USERID != appuserid) continue;
|
||||
//if (!_weworkConfig.IsWhite(item.USERID, item.WW_CORP_APP.CORPID)) continue;
|
||||
var content = JsonSerializer.Serialize(new
|
||||
{
|
||||
msgtype = "text",
|
||||
text = new
|
||||
{
|
||||
content = message
|
||||
},
|
||||
agentid = item.WW_CORP_APP.APPID.ToString(),
|
||||
toparty = "",
|
||||
totag = "",
|
||||
touser = item.USERID,
|
||||
safe = 0
|
||||
});
|
||||
var data = new
|
||||
{
|
||||
appid = item.WW_CORP_APP.CORPID,
|
||||
agentid = item.WW_CORP_APP.APPID,
|
||||
data = content
|
||||
};
|
||||
var response = await _httpClient.PostSecurityAsync<WeworkResponse<object?>>(_systemConfig.WeworkSendUrl, param, data, clientid, _systemConfig.GetAccessKey(clientid));
|
||||
if (response.ErrCode != 0)
|
||||
{
|
||||
Log.Error($"请求企微推送消息接口报错:{response.RrrMessage}, ex:{JsonSerializer.Serialize(response)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<NotificationDto>> GetNotificationsByEid(decimal eid, string appid)
|
||||
{
|
||||
if (!await _cacheDomain.SetApp(_repository, appid))
|
||||
{
|
||||
Log.Error($"【{appid}】 非法的Appid,无法切换app!");
|
||||
return new List<NotificationDto>();
|
||||
}
|
||||
var notifications = new List<BAS_NOTIFICATION>();
|
||||
foreach (var type in Enum.GetValues<NotificationType>())
|
||||
{
|
||||
var notification = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Where(x => x.READ == 0)
|
||||
.Where(x => x.NOTIFICATIONTYPE == type)
|
||||
.OrderByDescending(x => x.CTIME)
|
||||
.FirstOrDefaultAsync();
|
||||
if (notification != null) notifications.Add(notification);
|
||||
}
|
||||
return _mapper.Map<BAS_NOTIFICATION, NotificationDto>(notifications);
|
||||
}
|
||||
|
||||
private async Task<BAS_NOTIFICATION> GetNotificationByEid(decimal eid, string appid, NotificationType notificationType)
|
||||
{
|
||||
if (!await _cacheDomain.SetApp(_repository, appid))
|
||||
{
|
||||
Log.Error($"【{appid}】 非法的Appid,无法切换app!");
|
||||
return new BAS_NOTIFICATION();
|
||||
}
|
||||
var data = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Where(x => x.READ == 0)
|
||||
.Where(x => x.NOTIFICATIONTYPE == notificationType)
|
||||
.OrderByDescending(x => x.CTIME)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
{
|
||||
data = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Where(x => x.NOTIFICATIONTYPE == notificationType)
|
||||
.OrderByDescending(x => x.CTIME)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<PageResult<NotificationDto>> GetNotificationsPage(NotificationSearchPageDto search)
|
||||
{
|
||||
var excludeEids = await _cacheDomain.GetParameter<List<decimal>>(ParameterEnums.CRM_CORE_NOTIFICATION_EXCLUDE);
|
||||
|
||||
var query = _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == search.Eid)
|
||||
.If(search.Read != null, x => x.Where(y => y.READ == search.Read))
|
||||
.If(search.TimeFrom != null, x => x.Where(y => y.CTIME >= search.TimeFrom))
|
||||
.If(search.TimeTo != null, x => x.Where(y => y.CTIME < search.TimeTo.Value.AddDays(1)))
|
||||
.If(excludeEids != null && excludeEids.Any(), x => x.Where(y => !excludeEids.Contains(y.EID.Value)))
|
||||
.If(search.NotificationType != null, x => x.Where(y => y.NOTIFICATIONTYPE == search.NotificationType))
|
||||
.If(search.ComplaintType.HasValue, x => x.Where(y => y.MESSAGE.Contains(Enum.GetName(typeof(ComplaintType), search.ComplaintType))))
|
||||
.If(search.ComplaintReason.HasValue, x => x.Where(y => y.MESSAGE.Contains(Enum.Parse<ComplaintReason>(search.ComplaintReason.ToString()).GetDescription())));
|
||||
|
||||
var total = await query.CountAsync();
|
||||
var data = await query
|
||||
.OrderBy(x => x.READ)
|
||||
.ThenByDescending(x => x.CTIME)
|
||||
.Skip((search.PageIndex - 1) * search.PageSize)
|
||||
.Take(search.PageSize)
|
||||
.ToListAsync();
|
||||
var result = _mapper.Map<BAS_NOTIFICATION, NotificationDto>(data);
|
||||
return new PageResult<NotificationDto>(search.PageIndex, search.PageSize, total, result);
|
||||
}
|
||||
|
||||
public async Task<bool> Read(List<decimal> messageIds)
|
||||
{
|
||||
var eid = await _cacheDomain.GetCurrentEid();
|
||||
var notifications = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => messageIds.Contains(x.ID))
|
||||
.ToListAsync();
|
||||
var enabled = await _cacheDomain.GetValueParameter(ParameterEnums.CRM_CORE_NOTIFICATION_ENABLED);
|
||||
if (notifications != null && notifications.Any())
|
||||
{
|
||||
try
|
||||
{
|
||||
using var transaction = await _repository.BeginTransactionAsync();
|
||||
foreach (var notification in notifications)
|
||||
{
|
||||
notification.READ = 1;
|
||||
notification.READTIME = DateTime.Now;
|
||||
await _repository.GetRepository<BAS_NOTIFICATION>().UpdateAsync(notification);
|
||||
}
|
||||
await transaction.CommitAsync();
|
||||
if (enabled == "1")
|
||||
{
|
||||
foreach (var type in Enum.GetValues<NotificationType>())
|
||||
{
|
||||
var notifi = await GetNotificationByEid(eid, _cacheDomain.GetApp(), type);
|
||||
var data = notifi == null ? notifications.FirstOrDefault()
|
||||
: notifi;
|
||||
await _notificationHub.Send(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "更新已读报错!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<bool> RealAll()
|
||||
{
|
||||
var eid = await _cacheDomain.GetCurrentEid();
|
||||
var notifications = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Where(x => x.READ == 0)
|
||||
.ToListAsync();
|
||||
var enabled = await _cacheDomain.GetValueParameter(ParameterEnums.CRM_CORE_NOTIFICATION_ENABLED);
|
||||
if (notifications != null && notifications.Any())
|
||||
{
|
||||
try
|
||||
{
|
||||
using var transaction = await _repository.BeginTransactionAsync();
|
||||
foreach (var notification in notifications)
|
||||
{
|
||||
notification.READ = 1;
|
||||
notification.READTIME = DateTime.Now;
|
||||
await _repository.GetRepository<BAS_NOTIFICATION>().UpdateAsync(notification);
|
||||
}
|
||||
await transaction.CommitAsync();
|
||||
if (enabled == "1")
|
||||
{
|
||||
foreach (var type in Enum.GetValues<NotificationType>())
|
||||
{
|
||||
var notifi = await GetNotificationByEid(eid, _cacheDomain.GetApp(), type);
|
||||
var data = notifi == null ? notifications.FirstOrDefault()
|
||||
: notifi;
|
||||
await _notificationHub.Send(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "更新已读报错!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public async Task<LivePageDto<NotificationStatisticsDto>> GetNotificationStatisticsPage(NotificationStatisticsSearchPageDto dto)
|
||||
{
|
||||
var url = _systemConfig.GetCustomerProtectionsUrl();
|
||||
var deptmentIds = await _cacheDomain.GetDeptmentIds();
|
||||
var eid = await _cacheDomain.GetCurrentEid();
|
||||
if (deptmentIds == null || !deptmentIds.Any())
|
||||
{
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
}
|
||||
// 处理筛选的事业部
|
||||
if (dto.Txt_groupIds != null && dto.Txt_groupIds.HasValue)
|
||||
{
|
||||
var sales = await _cacheDomain.GetSalesDeptList();
|
||||
if (!sales.Any(x => x.SalesGroupId == dto.Txt_groupIds))
|
||||
{
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
}
|
||||
dto.ShowGroupIds = string.Join(",", sales.First(x => x.SalesGroupId == dto.Txt_groupIds).GroupIds);
|
||||
}
|
||||
else if (dto.Txt_deptId != null && dto.Txt_deptId.HasValue)
|
||||
{
|
||||
var sales = await _cacheDomain.GetSalesDeptList();
|
||||
if (!sales.Any(x => x.SalesGroupId == dto.Txt_deptId))
|
||||
{
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
|
||||
}
|
||||
dto.ShowGroupIds = string.Join(",", sales.First(x => x.SalesGroupId == dto.Txt_deptId).GroupIds);
|
||||
}
|
||||
// 处理筛选员工ID
|
||||
if (dto.Eid != null && dto.UserId != null && (dto.Eid != dto.UserId || dto.RepeatEid != dto.UserId))
|
||||
{
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
}
|
||||
if (dto.Eid != null && dto.UserId == null)
|
||||
{
|
||||
var level = await _cacheDomain.LevelSSO(eid);
|
||||
switch (level)
|
||||
{
|
||||
case RoleLevel.Self:
|
||||
if (dto.Eid != eid) return new LivePageDto<NotificationStatisticsDto>();
|
||||
break;
|
||||
case RoleLevel.Dept:
|
||||
var eids = await _cacheDomain.GetSalesDeptsForEid(eid);
|
||||
if (!eids.Contains(dto.Eid.Value)) return new LivePageDto<NotificationStatisticsDto>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dto.RepeatEid != null && dto.UserId == null)
|
||||
{
|
||||
var level = await _cacheDomain.LevelSSO(eid);
|
||||
switch (level)
|
||||
{
|
||||
case RoleLevel.Self:
|
||||
if (dto.RepeatEid != eid) return new LivePageDto<NotificationStatisticsDto>();
|
||||
break;
|
||||
case RoleLevel.Dept:
|
||||
var eids = await _cacheDomain.GetSalesDeptsForEid(eid);
|
||||
if (!eids.Contains(dto.RepeatEid.Value)) return new LivePageDto<NotificationStatisticsDto>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
dto.ShowEid = dto.UserId != null ? dto.UserId : null;
|
||||
var excludeEids = await _cacheDomain.GetParameter<List<decimal>>(ParameterEnums.CRM_CORE_NOTIFICATION_EXCLUDE);
|
||||
if (excludeEids != null && excludeEids.Any())
|
||||
{
|
||||
dto.ExcludeRepeatEids = string.Join(",", excludeEids);
|
||||
}
|
||||
dto.SortBy = "cross_dept desc, repeat_end_time desc";
|
||||
dto.RepeatEndTime = !string.IsNullOrEmpty(dto.RepeatEndTime) ? DateTime.Parse(dto.RepeatEndTime).AddDays(1).ToString("yyyy-MM-dd")
|
||||
: dto.RepeatEndTime;
|
||||
dto.EndTime = !string.IsNullOrEmpty(dto.EndTime) ? DateTime.Parse(dto.EndTime).AddDays(1).ToString("yyyy-MM-dd")
|
||||
: dto.EndTime;
|
||||
|
||||
dto.ShowDeptids = string.Join(",", deptmentIds);
|
||||
|
||||
if (dto.DeptId != null && dto.RepeatDeptId != null)
|
||||
{
|
||||
dto.Deptids = dto.DeptId != null ? dto.DeptId.ToString() : "";
|
||||
dto.RepeatDeptids = dto.RepeatDeptId != null ? dto.RepeatDeptId.ToString() : "";
|
||||
}
|
||||
if (dto.DeptId != null
|
||||
&& dto.RepeatDeptId != null
|
||||
&& !deptmentIds.Contains(dto.DeptId.Value)
|
||||
&& !deptmentIds.Contains(dto.RepeatDeptId.Value))
|
||||
{
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
}
|
||||
Log.Information($"{url} 查询事业部:{dto.Deptids}");
|
||||
var options = new JsonSerializerOptions
|
||||
{
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
var dtoStr = JsonSerializer.Serialize(dto, options);
|
||||
var param = JsonSerializer.Deserialize<Dictionary<string, object>>(dtoStr);
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetAsync<ApiResult<LivePageDto<NotificationStatisticsDto>>>($"{url}", param);
|
||||
if (response.Code == 0)
|
||||
{
|
||||
foreach (var item in response.Data.TableData)
|
||||
{
|
||||
item.RepeatEndTime = item.RepeatDays > 1 ? DateTime.Parse(item.RepeatEndTime).ToString("yyyy-MM-dd") : "--";
|
||||
item.RepeatStartTime = DateTime.Parse(item.RepeatStartTime).ToString("yyyy-MM-dd");
|
||||
item.EndTime = DateTime.Parse(item.EndTime).ToString("yyyy-MM-dd");
|
||||
item.RepeatTypeStr = item.RepeatType == 1 ? "企微联系" : item.RepeatType == 2 ? "电话联系" : "企微和电话联系";
|
||||
}
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, $"{_systemConfig.GetCustomerProtectionsUrl()} 请求出错,param: {dtoStr}");
|
||||
throw new ApiException("大数据接口请求报错!");
|
||||
}
|
||||
return new LivePageDto<NotificationStatisticsDto>();
|
||||
}
|
||||
|
||||
public async Task<int> GetMessageCount(decimal? eid, NotificationType? notificationType = null, string? connectionId = "")
|
||||
{
|
||||
if (eid == null) return 0;
|
||||
var count = await _repository.GetRepository<BAS_NOTIFICATION>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Where(x => x.READ == 0)
|
||||
.If(notificationType != null, x => x.Where(x => x.NOTIFICATIONTYPE == notificationType))
|
||||
.CountAsync();
|
||||
if (count > 0 && !string.IsNullOrEmpty(connectionId))
|
||||
{
|
||||
await _notificationHub.SendUserMessage(new OnlineUserInfoDto
|
||||
{
|
||||
Eid = eid.Value,
|
||||
Appid = _cacheDomain.GetApp(),
|
||||
ConnectionId = connectionId
|
||||
});
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public async Task SendMessage(SendMessageDto dto)
|
||||
{
|
||||
var deptments = await _cacheDomain.GetDeptments();
|
||||
if (deptments == null || !deptments.Any())
|
||||
{
|
||||
Log.Error($"无法获取事业部列表!");
|
||||
throw new ApiException($"无法获取事业部列表!");
|
||||
}
|
||||
if (dto.Channel != null && dto.Deptid == null)
|
||||
{
|
||||
foreach (var deptment in deptments)
|
||||
{
|
||||
foreach (var deptmentCampain in deptment.DeptmentCampains ?? new List<DeptmentCampainDto>())
|
||||
{
|
||||
if (dto.Channel >= deptmentCampain.StartCampainId && dto.Channel <= deptmentCampain.EndCampainId)
|
||||
{
|
||||
dto.Deptid = deptment.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dto.Deptid == null || dto.Deptid == 0)
|
||||
{
|
||||
throw new ApiException($"无法匹配正确的事业部,请检查请求的渠道号或事业线id!");
|
||||
}
|
||||
if (dto.IsDepartment)
|
||||
{
|
||||
var eids = await _cacheDomain.GetLeadEid(dto.Deptid ?? 0, dto.Eid);
|
||||
foreach (var eid in eids)
|
||||
{
|
||||
await _notificationHub.SendMessage(new SendMessageDto
|
||||
{
|
||||
Deptid = dto.Deptid,
|
||||
Channel = dto.Channel,
|
||||
Message = dto.Message,
|
||||
Eid = eid,
|
||||
Method = dto.Method,
|
||||
Resid = dto.Resid,
|
||||
Umid = dto.Umid,
|
||||
IsDepartment = dto.IsDepartment,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _notificationHub.SendMessage(dto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<RepeatDeptmentDto> GetRepeatDeptments()
|
||||
{
|
||||
var result = new RepeatDeptmentDto();
|
||||
var deptmentIds = await _cacheDomain.GetDeptmentIds();
|
||||
|
||||
if (deptmentIds == null || !deptmentIds.Any())
|
||||
return result;
|
||||
|
||||
var show_deptids = string.Join(",", deptmentIds);
|
||||
|
||||
var url = _systemConfig.GetCustomerProtectionDepts();
|
||||
var dealDpet = await _httpClient.GetAsync<ApiResult<List<RepeatDeptments>>>($"{url}?repeat=0&show_deptids={show_deptids}");
|
||||
if (dealDpet.Code == 0 && dealDpet.Data != null)
|
||||
result.DealDepts = dealDpet.Data.Where(x => x.deptid > 0 && !string.IsNullOrWhiteSpace(x.deptname)).ToList();
|
||||
|
||||
var repeatDpet = await _httpClient.GetAsync<ApiResult<List<RepeatDeptments>>>($"{url}?repeat=1&show_deptids={show_deptids}");
|
||||
if (repeatDpet.Code == 0 && dealDpet.Data != null)
|
||||
result.RepeatDepts = repeatDpet.Data.Where(x => x.deptid > 0 && !string.IsNullOrWhiteSpace(x.deptname)).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,515 @@
|
|||
using Crm.Core.Domain.Dto.Order;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
internal class OrderDomain : IOrderDomain
|
||||
{
|
||||
private readonly ICacheDomain _cacheDomain;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly IUserInfoDomain _userInfoDomain;
|
||||
private readonly SystemConfig _systemConfig;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IHttpClient _httpClient;
|
||||
|
||||
public OrderDomain(ICacheDomain cacheDomain, IConfiguration configuration, IHttpClient httpClient,
|
||||
IServiceProvider serviceProvider, IUserInfoDomain userInfoDomain)
|
||||
{
|
||||
_cacheDomain = cacheDomain;
|
||||
_serviceProvider = serviceProvider;
|
||||
_userInfoDomain = userInfoDomain;
|
||||
_configuration = configuration;
|
||||
_systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public async Task UpdateOrderRealName(UpdateOrderRealNameDto dto)
|
||||
{
|
||||
var appid = _cacheDomain.GetApp();
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
Log.Information($"更新的实名信息,appid: {appid}, {dto.ToJson()}");
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, appid);
|
||||
var orders = await repository.GetRepository<WX_SZZYORDER>().Query()
|
||||
.Where(x => dto.Orderids.Contains(x.ORDERID)).ToListAsync() ?? throw new ApiException("订单信息不存在!");
|
||||
orders.ForEach(order =>
|
||||
{
|
||||
order.CNAME = dto.RealName;
|
||||
});
|
||||
await repository.GetRepository<WX_SZZYORDER>().BatchUpdateAsync(orders, x => new { x.CNAME });
|
||||
}
|
||||
|
||||
#region 企微侧边栏 创建订单
|
||||
|
||||
/// <summary>
|
||||
/// 获取创建订单需要的信息
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<CreateOrderInfo> GetCreateOrderSelectItem(GetCreateOrderQueryDto dto)
|
||||
{
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, dto.deptid.Value);
|
||||
//获取用户信息
|
||||
CreateOrderInfo res = new CreateOrderInfo();
|
||||
|
||||
var userList = await _userInfoDomain.GetUserInfoByApi(dto.appid, dto.extuserid);
|
||||
var resids = userList.Where(n => !string.IsNullOrWhiteSpace(n.resid)).Select(n => n.resid).Distinct().ToList();
|
||||
var customerList = await repository.GetRepository<RES_CUSTOMER>().Query().Where(n => resids.Contains(n.RESID)).ToListAsync();
|
||||
var customerdetail = await repository.GetRepository<RES_CUSTOMERDETAIL>().Query().Where(n => resids.Contains(n.RESID)).ToListAsync();
|
||||
var softuserList = await repository.GetRepository<SOFT_USER>().Query().Where(n => resids.Contains(n.RESID)).ToListAsync();
|
||||
List<RescustomerInfo> customerinfos = new List<RescustomerInfo>();
|
||||
foreach (var item in softuserList)
|
||||
{
|
||||
customerinfos.Add(new RescustomerInfo
|
||||
{
|
||||
username = item.USERNAME,
|
||||
umid = customerList.FirstOrDefault(n => n.RESID == item.RESID)?.UMID,
|
||||
cname = customerdetail.FirstOrDefault(n => n.RESID == item.RESID)?.CNAME,
|
||||
});
|
||||
}
|
||||
res.userinfos = customerinfos;
|
||||
//获取所有有渠道的部门
|
||||
List<DeptList> deptLists = new List<DeptList>();
|
||||
var deptList = await repository.GetRepository<BAS_SALESDEPARTMENT>().Query().Where(p => p.CHANNELDEF != null && p.CHANNELDEF != 0).ToListAsync();
|
||||
|
||||
foreach (var dept in deptList)
|
||||
{
|
||||
deptLists.Add(new DeptList { deptname = dept.DEPTNAME, saledeptcode = dept.SALEDEPTCODE });
|
||||
}
|
||||
res.deptLists = deptLists;
|
||||
var minproduct = await repository.GetRepository<WX_SZZYMIDPRODUCT>().Query().ToListAsync();
|
||||
List<MinProductInfo> minProductInfos = new List<MinProductInfo>();
|
||||
foreach (var min in minproduct)
|
||||
{
|
||||
minProductInfos.Add(new MinProductInfo { minproductid = min.MIDPRODUCTID, minproductname = min.MIDPRODUCTNAME });
|
||||
}
|
||||
res.minProductInfos = minProductInfos;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据大类获取产品编码
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ProductInfo>> GetProductByMinType(ProductQueryByMinProductId dto)
|
||||
{
|
||||
List<ProductInfo> res = new List<ProductInfo>();
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, dto.deptid.Value);
|
||||
var proList = await repository.GetRepository<WX_SZZYSUBPRODUCT>().Query().Where(n => n.ISVALID == 1 && n.ISSHOW == 1 && n.MIDPRODUCTID == dto.minProductId).ToListAsync();
|
||||
foreach (var pro in proList)
|
||||
{
|
||||
res.Add(new ProductInfo { productCode = pro.PRODUCTCODE, productName = pro.SUBPRODUCTNAME + "(" + pro.RIGHTPERIOD + ")" });
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取产品信息 折扣价等
|
||||
/// </summary>
|
||||
/// <param name="productcode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ProductDetail> GetProductDetail(ProductQueryDto dto)
|
||||
{
|
||||
ProductDetail res = new ProductDetail();
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, dto.deptid.Value);
|
||||
try
|
||||
{
|
||||
var subProduct = await repository.GetRepository<WX_SZZYSUBPRODUCT>().Query().FirstOrDefaultAsync(m => m.PRODUCTCODE == dto.productcode);
|
||||
if (subProduct == null)
|
||||
{
|
||||
throw new Exception("找不到对应的产品");
|
||||
}
|
||||
res.price = subProduct.PRICE;
|
||||
res.days = subProduct.RIGHTPERIOD;
|
||||
List<decimal> custompriceList = new List<decimal>();
|
||||
//折扣价格
|
||||
if (!string.IsNullOrEmpty(subProduct.CUSTOMPRICE))
|
||||
{
|
||||
var newList = subProduct.CUSTOMPRICE.Split(',').Where(n => !string.IsNullOrWhiteSpace(n)).Select(n => Convert.ToDecimal(n)).ToList();
|
||||
custompriceList.AddRange(newList);
|
||||
if (!string.IsNullOrEmpty(subProduct.HID_CUSTOMPRICE))
|
||||
{
|
||||
var oldList = subProduct.CUSTOMPRICE.Split(',');
|
||||
var hideList = subProduct.HID_CUSTOMPRICE.Split(',');
|
||||
var otherlist = oldList.Where(m => !hideList.Contains(m)).Where(n => !string.IsNullOrWhiteSpace(n)).Select(n => Convert.ToDecimal(n)).ToList();
|
||||
custompriceList.AddRange(otherlist);
|
||||
}
|
||||
}
|
||||
res.customprisce = custompriceList;
|
||||
//折扣区间
|
||||
var pricerange = string.Empty;
|
||||
if (subProduct.ISDISCOUNTAREA == 1)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(subProduct.DISCOUNTAREA))
|
||||
{
|
||||
var area = JsonHelper.FromJson<List<DiscountArea>>(subProduct.DISCOUNTAREA);
|
||||
var range = area.Where(p => p.IsShow == 1).ToList();
|
||||
res.discountAreas = range;
|
||||
}
|
||||
}
|
||||
var gifts = await repository.GetRepository<WX_SZZYSUBPRODUCT_GIFT>().Query().Where(m => m.SUBPRODUCTID == subProduct.SUBPRODUCTID).ToListAsync();
|
||||
|
||||
//赠送天数
|
||||
if (subProduct.ISGIFT == 1 && gifts.Any())
|
||||
{
|
||||
List<decimal> mma = new List<decimal> { 1, 2 };
|
||||
var orderactiveList = await repository.GetRepository<WX_ORDERACTIVE>().Query().Where(M => M.PRODUCTCODE == subProduct.PRODUCTCODE && M.GIFTYPE.Contains("[Order]") && mma.Contains(M.ISFOLLOWORDER.Value)).ToListAsync();//订单的赠送配置
|
||||
var entr = orderactiveList.FirstOrDefault(m => m.ISFOLLOWORDER == 1);
|
||||
var giftData = new object { };
|
||||
if (entr != null)
|
||||
{
|
||||
res.giftInfos = gifts.Where(p => p.TYPE == 1 && p.ISSHOW == 1).OrderBy(p => p.SORT).Select(p => new GiftInfo { giftday = p.GIFTDAYS, giftdayname = p.GIFTDAYSNAME, giftname = p.GIFTNAME }).ToList();
|
||||
}
|
||||
var entr2 = orderactiveList.FirstOrDefault(m => m.ISFOLLOWORDER == 2);
|
||||
var giftData2 = new object { };
|
||||
if (entr2 != null)
|
||||
{
|
||||
res.othergiftInfos = gifts.Where(p => p.TYPE == 2 && p.ISSHOW == 1).OrderBy(p => p.SORT).Select(p => new GiftInfo { giftday = p.GIFTDAYS, giftdayname = p.GIFTDAYSNAME, giftname = p.GIFTNAME }).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"获取产品错误{ex.Message}");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<bool> CreateOrder(CreateOrderDto dto)
|
||||
{
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, dto.deptid);
|
||||
var softuser = await repository.GetRepository<SOFT_USER>().Query().FirstOrDefaultAsync(n => n.USERNAME == dto.softUsername);
|
||||
if (softuser == null)
|
||||
{
|
||||
throw new Exception("客户信息不正确");
|
||||
}
|
||||
var customer = await repository.GetRepository<RES_CUSTOMER>().Query().FirstOrDefaultAsync(n => n.RESID == softuser.RESID);
|
||||
var customerdetail = await repository.GetRepository<RES_CUSTOMERDETAIL>().Query().FirstOrDefaultAsync(n => n.RESID == softuser.RESID);
|
||||
var subproduct = await repository.GetRepository<WX_SZZYSUBPRODUCT>().Query().FirstOrDefaultAsync(n => n.PRODUCTCODE == dto.productCode);
|
||||
var product = await repository.GetRepository<WX_SZZYPRODUCT>().Query().FirstOrDefaultAsync(n => n.PRODUCTID == subproduct.PRODUCTID);
|
||||
var user = await repository.GetRepository<BAS_INNERUSER>().Query().FirstOrDefaultAsync(n => n.EID == dto.eid);
|
||||
|
||||
var saledept = await repository.GetRepository<BAS_SALESDEPARTMENT>().Query().FirstOrDefaultAsync(n => n.SALEDEPTCODE == dto.deptCode);
|
||||
var linedept = await _cacheDomain.GetDeptments();
|
||||
var comdept = linedept.FirstOrDefault(n => n.Id == dto.deptid);
|
||||
if (customer == null || customerdetail == null)
|
||||
{
|
||||
throw new Exception("客户信息不正确");
|
||||
}
|
||||
var key = _systemConfig.GetAccessKey(_systemConfig.CRMClientKey);
|
||||
var resourceMobile = await repository.GetRepository<RES_RESOURCEMOBILE>().FirstOrDefaultAsync(x => x.RESID == softuser.RESID);
|
||||
var mobile = SecurityHelper.DecyptData(resourceMobile.MOBILE, key);
|
||||
var themodel = new ordermodel
|
||||
{
|
||||
umid = customer.UMID,
|
||||
cname = customerdetail.CNAME,
|
||||
ordertype = dto.orderType,
|
||||
productId = subproduct.PRODUCTID.Value,
|
||||
productname = product.PRODUCTNAME,
|
||||
remark = dto.remark,
|
||||
saledeptid = null,
|
||||
source = dto.source,
|
||||
softusername = softuser.USERNAME,
|
||||
bigproductcode = product.PRODUCTCODE,
|
||||
productcode = subproduct.PRODUCTCODE,
|
||||
subProductId = subproduct.SUBPRODUCTID.Value,
|
||||
subproductname = subproduct.SUBPRODUCTNAME,
|
||||
userid = user.PKID,
|
||||
count = 1,
|
||||
productType = Convert.ToInt32(subproduct.PRODUCTTYPE),
|
||||
companycode = comdept.Code,
|
||||
upgradeorderids = dto.upgradeorderids,
|
||||
giftdays = dto.giftdays,
|
||||
giftdays2 = dto.giftdays2,
|
||||
customprisce = dto.customprisce,
|
||||
estimateotime = DateTime.Now,
|
||||
eid = dto.eid,
|
||||
deptcode = dto.deptCode,
|
||||
channel = saledept?.CHANNELMIN,
|
||||
mobile = mobile,
|
||||
opendays = subproduct?.RIGHTPERIOD,
|
||||
discount = dto.pricerange,
|
||||
needpay = dto.customprisce.HasValue ? dto.customprisce : dto.pricerange.HasValue ? dto.pricerange : subproduct.PRICE
|
||||
};
|
||||
if (themodel.source == "1")
|
||||
{
|
||||
themodel.corpid = dto.appid.Replace("_1", "");
|
||||
themodel.jobuserid = dto.appuserid;
|
||||
themodel.external_userid = dto.extuserid;
|
||||
}
|
||||
//调用中心点接口.
|
||||
var url = await _cacheDomain.GetValueParameter("Core_ZxdService_CreateOrder");
|
||||
var clientid = "UPWEBSITE";
|
||||
var clientKey = _systemConfig.GetAccessKey(clientid);
|
||||
var postJson = SecurityHelper.CreateSignEncodingStr(themodel.ToJson(), clientid, clientKey);
|
||||
var retmsg = HttpHelper.GetData(url, postJson, Encoding.UTF8);
|
||||
retmsg = SecurityHelper.DecyptData(retmsg, clientKey);
|
||||
CreateOrderRsp retmessage = JsonHelper.FromJson<CreateOrderRsp>(retmsg);
|
||||
if (retmessage.retCode == 10000)//成功
|
||||
{
|
||||
//创建订单
|
||||
WX_SZZYORDER order = new WX_SZZYORDER
|
||||
{
|
||||
UPGRADEORDERIDS = dto.upgradeorderids,
|
||||
OPERATETIME = DateTime.Now,
|
||||
INNERUSERID = user?.PKID,
|
||||
EID = user?.EID,
|
||||
RESID = customer.RESID,
|
||||
UMID = customer.UMID,
|
||||
ISFINANCEPAY = 0,
|
||||
OPENORDER = 0,
|
||||
ISOPEN = 0,
|
||||
ORDERTYPE = dto.orderType,
|
||||
ORDERSTATUS = "180",
|
||||
ORDERSTATUSNAME = "新订单",
|
||||
PRODUCTNAME = product.PRODUCTNAME,
|
||||
NEEDPAY = themodel.needpay,
|
||||
RETURNNEEDPAY = subproduct.PRICE,
|
||||
SOURCE = dto.source,
|
||||
PRODUCTID = product.PRODUCTID,
|
||||
SUBPRODUCTID = subproduct.SUBPRODUCTID,
|
||||
CTIME = DateTime.Now,
|
||||
RET = dto.pricerange,
|
||||
RETP = dto.customprisce,
|
||||
SUBPRODUCTNAME = subproduct.SUBPRODUCTNAME,
|
||||
OPENDAYS = subproduct.RIGHTPERIOD,
|
||||
CNAME = themodel?.cname,
|
||||
ESTIMATEOTIME = themodel.estimateotime,
|
||||
TOTALUPGRADEVALUE = themodel.totalupgradevalue,
|
||||
REQUESTSTATUS = 1,
|
||||
GIFTDAYS = themodel.giftdays,
|
||||
GIFTDAYS2 = themodel.giftdays2,
|
||||
DEPTCODE = themodel.deptcode,
|
||||
SZZYORDERID = Convert.ToDecimal(retmessage.orderId),
|
||||
ORDERID = Convert.ToDecimal(retmessage.selfOirderId),
|
||||
FCTEXT = $"{dto.eid}:100%"
|
||||
};
|
||||
if (dto.source == "1")
|
||||
{
|
||||
order.EXTERNAL_USERID = dto.extuserid;
|
||||
}
|
||||
await repository.GetRepository<WX_SZZYORDER>().InsertAsync(order);
|
||||
var payNo = "";
|
||||
int? paytype = 0;
|
||||
if (dto.payInfo != null && dto.payInfo.Count > 0)
|
||||
{
|
||||
payNo = dto.payInfo[0].payno;
|
||||
paytype = dto.payInfo[0].paytype;
|
||||
}
|
||||
var orderExt = new WX_ORDEREXT
|
||||
{
|
||||
ORDERID = order.ORDERID,
|
||||
PAYNO = payNo,
|
||||
ISPAYED = 0,
|
||||
OPENDAYS = order.OPENDAYS,
|
||||
NAME = order.CNAME,
|
||||
SOFTUSERNAME = softuser.USERNAME,
|
||||
PAYTYPE = paytype > 0 ? paytype : null,
|
||||
BOOKNUM = 1,
|
||||
CHANNEL = themodel.channel.ToString()
|
||||
};
|
||||
await repository.GetRepository<WX_ORDEREXT>().InsertAsync(orderExt);
|
||||
//设置分成
|
||||
try
|
||||
{
|
||||
var pkid = await _cacheDomain.GetSeq_smallid_get(dto.deptid);
|
||||
var usergroup = await repository.GetRepository<BAS_INNERUSERGROUP>().FirstOrDefaultAsync(n => n.INNERUSERID == user.PKID);
|
||||
var wxCommissionRuleModel = new WX_COMMISSIONRULE()
|
||||
{
|
||||
PKID = pkid,
|
||||
ORDERID = order.ORDERID,
|
||||
SZZYORDERID = order.SZZYORDERID,
|
||||
SALEUSERID = user.PKID,
|
||||
EID = order.EID,
|
||||
COMMISSIONRATIO = 100,
|
||||
ISMAIN = 1,
|
||||
CREATEUSERID = user.PKID,
|
||||
CREATETIME = DateTime.Now,
|
||||
ENAME = user?.UNAME,
|
||||
};
|
||||
if (usergroup != null)
|
||||
{
|
||||
var group = await repository.GetRepository<BAS_INNERGROUP>().FirstOrDefaultAsync(n => n.GID == usergroup.GID);
|
||||
if (group == null)
|
||||
{
|
||||
var dept = await repository.GetRepository<BAS_SALESDEPARTMENT>().FirstOrDefaultAsync(n => n.SALEDEPTID == usergroup.DEPTID);
|
||||
wxCommissionRuleModel.GID = dept?.SALEDEPTID;
|
||||
wxCommissionRuleModel.GNAME = dept?.DEPTNAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCommissionRuleModel.GID = group.GID;
|
||||
wxCommissionRuleModel.GNAME = group.GNAME;
|
||||
}
|
||||
}
|
||||
await repository.GetRepository<WX_COMMISSIONRULE>().InsertAsync(wxCommissionRuleModel);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"订单{order.ORDERID}设置分成失败{ex.Message}");
|
||||
}
|
||||
//提交支付记录
|
||||
if (dto.payInfo != null && dto.payInfo.Count > 0)
|
||||
{
|
||||
var orderuselist = new List<OrderuseDto>() {
|
||||
new OrderuseDto() { orderid = Convert.ToInt32(order.ORDERID), needpay = themodel.needpay.Value, arrivalpay = 0 }
|
||||
};
|
||||
List<PayInfoDto> paylist = new List<PayInfoDto>();
|
||||
foreach (var pay in dto.payInfo)
|
||||
{
|
||||
var paytypename = "未知";
|
||||
switch (int.Parse(pay.paytype.ToString()))
|
||||
{
|
||||
case 1: paytypename = "支付宝"; break;
|
||||
case 3: paytypename = "银行转账"; break;
|
||||
case 5: paytypename = "微信支付"; break;
|
||||
}
|
||||
paylist.Add(new PayInfoDto
|
||||
{
|
||||
resid = order.RESID,
|
||||
paytype = pay.paytype,
|
||||
paytypename = paytypename,
|
||||
paydate = pay.paydate,
|
||||
payprice = pay.payprice,
|
||||
payname = pay.payname,
|
||||
remark = pay.remark,
|
||||
payno = pay.payno,
|
||||
isuse = 0,
|
||||
companycode = themodel.companycode,
|
||||
tradeno = null,
|
||||
creator = Convert.ToInt32(user.EID),
|
||||
creatorname = user.UNAME
|
||||
});
|
||||
}
|
||||
var paydto = new PayPostZxdDto
|
||||
{
|
||||
orderuselist = orderuselist,
|
||||
resid = order.RESID,
|
||||
deptcode = themodel.deptcode,
|
||||
paylist = paylist
|
||||
};
|
||||
var payurl = await _cacheDomain.GetValueParameter("Core_PayService_OrderPay");
|
||||
var paypost = SecurityHelper.CreateSignEncodingStr(paydto.ToJson(), clientid, clientKey);
|
||||
Log.Information("payurl:" + payurl + "?" + paypost);
|
||||
var rep = HttpHelper.GetData(payurl, paypost, Encoding.UTF8);
|
||||
var payretmsg = JsonHelper.FromJson<retMsg<List<DepositInfoDto>>>(rep);
|
||||
if (payretmsg.result)
|
||||
{
|
||||
var paynoFilter = paydto.paylist.Select(n => n.payno).ToList();
|
||||
var depostList = await repository.GetRepository<WX_SZZYORDERDEPOSIT>().Query().Where(p => paynoFilter.Contains(p.PAYNO) && p.AUDITSTATUS == 1 && p.PAYNO != null).ToListAsync();
|
||||
List<WX_SZZYORDERDEPOSIT> adddepostList = new List<WX_SZZYORDERDEPOSIT>();
|
||||
foreach (var payinfo in paydto.paylist)
|
||||
{
|
||||
decimal usepriceall = 0;
|
||||
decimal lastpriceall = 0;
|
||||
//查看是否已经有确认到账记录
|
||||
var depost = depostList.FirstOrDefault(n => n.PAYNO == payinfo.payno);
|
||||
var depositId = 0;
|
||||
if (depost == null)
|
||||
{
|
||||
var depositinfiList = payretmsg.retmsg;
|
||||
depositId = depositinfiList.Find(p => p.payno == payinfo.payno).id;
|
||||
|
||||
lastpriceall = payinfo.payprice;
|
||||
}
|
||||
else
|
||||
{
|
||||
depositId = Convert.ToInt32(depost.ID);
|
||||
//如果已经存在说明已经使用过了,那要重新计算使用金额跟剩余金额
|
||||
usepriceall = depost.USEPRICE ?? 0;
|
||||
lastpriceall = depost.LASTPRICE ?? 0;
|
||||
}
|
||||
foreach (var item in paydto.orderuselist)
|
||||
{
|
||||
if (lastpriceall <= 0)
|
||||
{
|
||||
//如果剩余金额小于等于0,说明已经没钱支付了,不执行下面的操作
|
||||
continue;
|
||||
}
|
||||
order = await repository.GetRepository<WX_SZZYORDER>().FirstOrDefaultAsync(n => n.ORDERID == order.ORDERID);
|
||||
if (order == null)
|
||||
throw new Exception("参数错误,未能找到订单!");
|
||||
else
|
||||
{
|
||||
//如果已经支付过,赋值到当前临时记录的到账金额
|
||||
if (order.ARRIVALPAY.HasValue)
|
||||
item.arrivalpay = order.ARRIVALPAY.Value;
|
||||
if (order.ORDERSTATUS == "180" || order.ORDERSTATUS == "190" || order.ORDERSTATUS == "195")
|
||||
{
|
||||
order.ORDERSTATUS = "190";
|
||||
order.ORDERSTATUSNAME = "已提交支付";
|
||||
await repository.GetRepository<WX_SZZYORDER>().UpdateAsync(order);
|
||||
}
|
||||
else
|
||||
{
|
||||
//已经是支付状态,说明已经给够钱了,不需要再支付了
|
||||
Log.Information(order.ORDERID.ToString() + "支付金额已经够了,不需要再支付了!");
|
||||
continue;
|
||||
//return new retMsg { result = false, retcode = 100, retmsg = order.ORDERID.ToString() + "支付金额已经够了,不需要再支付了!" };
|
||||
}
|
||||
}
|
||||
}
|
||||
if (depost == null)
|
||||
{
|
||||
depost = new WX_SZZYORDERDEPOSIT
|
||||
{
|
||||
ID = depositId,
|
||||
RESID = payinfo.resid,
|
||||
PAYTYPE = payinfo.paytype,
|
||||
PAYTYPENAME = payinfo.paytypename,
|
||||
PAYDATE = payinfo.paydate,
|
||||
PAYPRICE = payinfo.payprice,
|
||||
PAYNAME = payinfo.payname,
|
||||
REMARK = payinfo.remark,
|
||||
PAYNO = payinfo.payno,
|
||||
ISUSE = payinfo.isuse,
|
||||
COMPANYCODE = payinfo.companycode,
|
||||
TRADENO = payinfo.tradeno,
|
||||
CREATOR = payinfo.creator,
|
||||
CREATORNAME = payinfo.creatorname,
|
||||
USEPRICE = usepriceall,
|
||||
LASTPRICE = lastpriceall,
|
||||
DEPTCODE = paydto.deptcode,
|
||||
CTIME = DateTime.Now
|
||||
};
|
||||
adddepostList.Add(depost);
|
||||
}
|
||||
else
|
||||
{
|
||||
depost.USEPRICE = usepriceall;
|
||||
depost.LASTPRICE = lastpriceall;
|
||||
}
|
||||
}
|
||||
if (adddepostList.Count > 0)
|
||||
{
|
||||
await repository.GetRepository<WX_SZZYORDERDEPOSIT>().BatchInsertAsync(adddepostList);
|
||||
}
|
||||
if (depostList.Count > 0)
|
||||
{
|
||||
await repository.GetRepository<WX_SZZYORDERDEPOSIT>().BatchUpdateAsync(depostList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion 企微侧边栏 创建订单
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Response
|
||||
{
|
||||
public class SaleClusResult<TData>
|
||||
{
|
||||
[JsonPropertyName("list")]
|
||||
public List<TData>? List { get; set; }
|
||||
|
||||
[JsonPropertyName("ret")]
|
||||
public int Ret { get; set; }
|
||||
|
||||
[JsonPropertyName("msg")]
|
||||
public string? Msg { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain.Response
|
||||
{
|
||||
public class SaleRelation
|
||||
{
|
||||
[JsonPropertyName("appid")]
|
||||
public string? Appid { get; set; }
|
||||
|
||||
[JsonPropertyName("appuserid")]
|
||||
public string? Appuserid { get; set; }
|
||||
|
||||
[JsonPropertyName("uid")]
|
||||
public int? Uid { get; set; }
|
||||
|
||||
[JsonPropertyName("mobile")]
|
||||
public string? Mobile { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
internal class UserDomain : IUserDomain
|
||||
{
|
||||
private readonly ICacheDomain _cacheDomain;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public UserDomain(ICacheDomain cacheDomain,
|
||||
IHttpClient httpClient,
|
||||
IConfiguration configuration,
|
||||
IServiceProvider serviceProvider)
|
||||
{
|
||||
_cacheDomain = cacheDomain;
|
||||
_httpClient = httpClient;
|
||||
_configuration = configuration;
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
public async Task<CrmUserDto> GetCrmUser(int eid)
|
||||
{
|
||||
var appid = _cacheDomain.GetApp();
|
||||
using var scope = _serviceProvider.CreateAsyncScope();
|
||||
var repository = scope.ServiceProvider.GetRequiredService<IOracleRepository<CrmDbContext>>();
|
||||
await _cacheDomain.SetApp(repository, appid);
|
||||
var user = await repository.GetRepository<BAS_INNERUSER>().Query()
|
||||
.Where(x => x.EID == eid)
|
||||
.Select(x=>new CrmUserDto
|
||||
{
|
||||
Eid = x.EID,
|
||||
Username = x.UNAME
|
||||
}).FirstOrDefaultAsync() ?? throw new ApiException("用户不存或已删除!");
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Domain
|
||||
{
|
||||
public class UserInfoDomain : IUserInfoDomain
|
||||
{
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly SystemConfig _systemConfig;
|
||||
|
||||
public UserInfoDomain(IHttpClient httpClient, IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_systemConfig = _configuration.GetSection("SystemConfig").Get<SystemConfig>();
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public async Task<List<UserInfoReq>> GetUserInfoByApi(string? appid, string? userid)
|
||||
{
|
||||
var res = new List<UserInfoReq>();
|
||||
var url = _systemConfig.ZxdUrl.Trim('/'); // _basParameterService.GetParameterValue("Zxd_CoreApiUrl");
|
||||
url = $"{url}/Api/UserInfo/list";
|
||||
var resModel = await _httpClient.GetAsync<ApiResult<List<UserInfoReq>>>($"{url}?appid={appid}&appuserid={userid}");
|
||||
res = resModel.Data;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="System.ComponentModel.DataAnnotations" />
|
||||
<Using Include="System.ComponentModel.DataAnnotations.Schema" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_BUSINESSDEPARTMENT")]
|
||||
public class BAS_BUSINESSDEPARTMENT
|
||||
{
|
||||
[Key]
|
||||
public decimal ID { get; set; }
|
||||
|
||||
public decimal BUSINESSID { get; set; }
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
public decimal DEPTID { get; set; }
|
||||
/// <summary>
|
||||
/// 1、主部门 2、子部门
|
||||
/// </summary>
|
||||
public int DEPTTYPE { get; set; }
|
||||
|
||||
public DateTime CTIME { get; set; }
|
||||
|
||||
public DateTime UTIME { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSERGROUP? BAS_INNERUSERGROUP { get; set; }
|
||||
|
||||
public virtual BAS_BUSINESSLINES? BAS_BUSINESSLINES { get; set; }
|
||||
|
||||
public virtual BAS_SALESDEPARTMENT? BAS_SALESDEPARTMENT { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_BUSINESSLINES")]
|
||||
public class BAS_BUSINESSLINES
|
||||
{
|
||||
[Key]
|
||||
public decimal BUSINESSID { get; set; }
|
||||
|
||||
public string? BUSINESSNAME { get; set; }
|
||||
|
||||
public int CHANNEL { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public virtual List<BAS_BUSINESSDEPARTMENT>? BAS_BUSINESSDEPARTMENT { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_COMPANY")]
|
||||
public class BAS_COMPANY
|
||||
{
|
||||
[Key]
|
||||
public decimal COMPANYID { get; set; }
|
||||
|
||||
public string? COMPANYNAME { get; set; }
|
||||
|
||||
public short? ISOUTERAGENT { get; set; }
|
||||
|
||||
public decimal? PARENTID { get; set; }
|
||||
|
||||
public string? COMPANYCODE { get; set; }
|
||||
|
||||
public decimal BUSINESSVALUE { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public string? COMMENTS { get; set; }
|
||||
|
||||
public string? SYSTEMCODE { get; set; }
|
||||
|
||||
public string? ORGANNAME { get; set; }
|
||||
|
||||
public virtual List<BAS_SALESDEPARTMENT>? BAS_SALESDEPARTMENT { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_GROUPLEADER")]
|
||||
public partial class BAS_GROUPLEADER
|
||||
{
|
||||
[Key]
|
||||
public decimal INNERGROUPID { get; set; }
|
||||
|
||||
public decimal INNERUSERID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public decimal? LEADERTYPE { get; set; }
|
||||
|
||||
public decimal? TYPE { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSER? BAS_INNERUSER { get; set; }
|
||||
|
||||
public virtual BAS_INNERGROUP? BAS_INNERGROUP { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
public class BAS_INNERDEPARTMENT
|
||||
{
|
||||
[Key]
|
||||
public decimal DEPTID { get; set; }
|
||||
|
||||
public string? DEPTNAME { get; set; }
|
||||
|
||||
public decimal PARENTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public string? INNERDEPTCODE { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERGROUP>? BAS_INNERGROUP { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERUSERGROUP>? BAS_INNERUSERGROUP { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_INNERGROUP")]
|
||||
public class BAS_INNERGROUP
|
||||
{
|
||||
[Key]
|
||||
public decimal GID { get; set; }
|
||||
|
||||
public decimal? SALEDEPTID { get; set; }
|
||||
|
||||
public string? GNAME { get; set; }
|
||||
|
||||
public decimal? DEPTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public short? ISHIDE { get; set; }
|
||||
|
||||
public short? ISSALEDEPT { get; set; }
|
||||
|
||||
public decimal? SORT { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工系统:对应的部门ID
|
||||
/// </summary>
|
||||
public decimal? DEPARTMENT_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:对应的部门编码
|
||||
/// </summary>
|
||||
public string? DEPARTMENT_CODE { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:是否为业务部门, 1为业务部门,0为其他部门
|
||||
/// </summary>
|
||||
public decimal? IS_PROFESSION { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:部门的父ID
|
||||
/// </summary>
|
||||
public decimal? DEPARTMENT_PARENTID { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:是否勾选1:是 0:否
|
||||
/// </summary>
|
||||
public decimal? ISCHECK { get; set; }
|
||||
public decimal? DEPARTMENT_SORT { get; set; }
|
||||
public decimal? IS_DELETED { get; set; }
|
||||
|
||||
public virtual BAS_INNERDEPARTMENT? BAS_INNERDEPARTMENT { get; set; }
|
||||
|
||||
public virtual BAS_SALESDEPARTMENT? BAS_SALESDEPARTMENT { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERUSERGROUP>? BAS_INNERUSERGROUP { get; set; }
|
||||
|
||||
public virtual List<BAS_GROUPLEADER>? BAS_GROUPLEADER { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_INNERUSER")]
|
||||
public class BAS_INNERUSER
|
||||
{
|
||||
[Key]
|
||||
public decimal PKID { get; set; }
|
||||
|
||||
public string? UNAME { get; set; }
|
||||
|
||||
public decimal EID { get; set; }
|
||||
|
||||
public string? GENDER { get; set; }
|
||||
|
||||
public DateTime BIRTHDAY { get; set; }
|
||||
|
||||
public string? PASSWORD { get; set; }
|
||||
|
||||
public short ISDISMISS { get; set; }
|
||||
|
||||
public DateTime? DISMISSTIME { get; set; }
|
||||
|
||||
public decimal? DISMISSTYPE { get; set; }
|
||||
|
||||
public DateTime? ENTRYDATE { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public DateTime? POSITIVETIME { get; set; }
|
||||
|
||||
public string? TRUENAME { get; set; }
|
||||
|
||||
public short ISHIDE { get; set; }
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public decimal? EMPLOYEE_ID { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSERGROUP? BAS_INNERUSERGROUP { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERUSERROLE>? BAS_INNERUSERROLE { get; set; }
|
||||
|
||||
public virtual List<BAS_GROUPLEADER>? BAS_GROUPLEADER { get; set; }
|
||||
|
||||
public virtual CACHE_ORD_MEMO? CACHE_ORD_MEMO { get; set; }
|
||||
|
||||
public virtual CSVR_CALLRECORD? CSVR_CALLRECORD { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_INNERUSERGROUP")]
|
||||
public class BAS_INNERUSERGROUP
|
||||
{
|
||||
[Key]
|
||||
public decimal INNERUSERID { get; set; }
|
||||
|
||||
public decimal? DEPTID { get; set; }
|
||||
|
||||
public decimal? GID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public decimal? COMPANYID { get; set; }
|
||||
|
||||
public virtual BAS_INNERDEPARTMENT? BAS_INNERDEPARTMENT { get; set; }
|
||||
|
||||
public virtual BAS_INNERGROUP? BAS_INNERGROUP { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSER? BAS_INNERUSER { get; set; }
|
||||
|
||||
public virtual BAS_SALESDEPARTMENT? BAS_SALESDEPARTMENT { get; set; }
|
||||
|
||||
public virtual BAS_BUSINESSDEPARTMENT? BAS_BUSINESSDEPARTMENT { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_INNERUSERROLE")]
|
||||
public partial class BAS_INNERUSERROLE
|
||||
{
|
||||
[Key]
|
||||
public decimal INNERUSERID { get; set; }
|
||||
|
||||
public decimal ROLEID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSER? BAS_INNERUSER { get; set; }
|
||||
|
||||
public virtual BAS_ROLE BAS_ROLE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_NOTIFICATION")]
|
||||
public class BAS_NOTIFICATION
|
||||
{
|
||||
public decimal ID { get; set; }
|
||||
|
||||
public string? NOTIFICATIONID { get; set; }
|
||||
|
||||
public string? NOTIFICATIONVALUE { get; set; }
|
||||
|
||||
public decimal? EID { get; set; }
|
||||
|
||||
public string? RESID { get; set; }
|
||||
|
||||
public string? UMID { get; set; }
|
||||
|
||||
public decimal? READ { get; set; }
|
||||
|
||||
public string? MESSAGE { get; set; }
|
||||
|
||||
public string? TOPIC { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public DateTime? READTIME { get; set; }
|
||||
|
||||
public NotificationType? NOTIFICATIONTYPE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_NOTIFICATION_STATISTICS")]
|
||||
public class BAS_NOTIFICATION_STATISTICS
|
||||
{
|
||||
[Key]
|
||||
public string? ID { get; set; }
|
||||
|
||||
public string? NAME { get; set; }
|
||||
|
||||
public string? RESID { get; set; }
|
||||
|
||||
public DateTime? ENDTIME { get; set; }
|
||||
|
||||
public decimal? DEPTID { get; set; }
|
||||
|
||||
public decimal? CHANNEL { get; set; }
|
||||
|
||||
public string? DEPTNAME { get; set; }
|
||||
|
||||
public decimal? EID { get; set; }
|
||||
|
||||
public string? ENAME { get; set; }
|
||||
|
||||
public int? REPEATTYPE { get; set; }
|
||||
|
||||
public int? CROSSDEPT { get; set; }
|
||||
|
||||
public decimal? REPEATDEPTID { get; set; }
|
||||
|
||||
public string? REPEATDEPTNAME { get; set; }
|
||||
|
||||
public decimal? REPEATEID { get; set; }
|
||||
|
||||
public string? REPEATENAME { get; set; }
|
||||
|
||||
public DateTime? REPEATSTARTTIME { get; set; }
|
||||
|
||||
public DateTime? REPEATENDTIME { get; set; }
|
||||
|
||||
public int? REPEATDAYS { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_PARAMETER")]
|
||||
public class BAS_PARAMETER
|
||||
{
|
||||
public string? PARAKEY { get; set; }
|
||||
|
||||
public string? GROUPID { get; set; }
|
||||
|
||||
public string? PARAVALUE { get; set; }
|
||||
|
||||
public string? PARATYPE { get; set; }
|
||||
|
||||
public string? REMARK { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public string? EDITFORM { get; set; }
|
||||
|
||||
public string? PARANAME { get; set; }
|
||||
|
||||
public string? DEPTCDOE { get; set; }
|
||||
|
||||
[Key]
|
||||
public decimal PKID { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_RIGHT")]
|
||||
public class BAS_RIGHT
|
||||
{
|
||||
[Key]
|
||||
public string? RIGHTID { get; set; }
|
||||
|
||||
public string? RNAME { get; set; }
|
||||
|
||||
public decimal SORTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public decimal? GROUPID { get; set; }
|
||||
|
||||
public virtual BAS_RIGHTGROUP BAS_RIGHTGROUP { get; set; }
|
||||
|
||||
public virtual List<BAS_ROLERIGHTRESOURCE>? BAS_ROLERIGHTRESOURCE { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_RIGHTGROUP")]
|
||||
public class BAS_RIGHTGROUP
|
||||
{
|
||||
[Key]
|
||||
public decimal PKID { get; set; }
|
||||
|
||||
public string? NAME { get; set; }
|
||||
|
||||
public decimal PARENTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public virtual List<BAS_RIGHT>? BAS_RIGHT { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_ROLE")]
|
||||
public class BAS_ROLE
|
||||
{
|
||||
[Key]
|
||||
public decimal ROLEID { get; set; }
|
||||
|
||||
public string? RNAME { get; set; }
|
||||
|
||||
public decimal SORTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
public string? CODE { get; set; }
|
||||
public string? REMARK { get; set; }
|
||||
|
||||
public virtual List<BAS_ROLERIGHTRESOURCE>? BAS_ROLERIGHTRESOURCE { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSERROLE? BAS_INNERUSERROLE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_ROLERIGHTRESOURCE")]
|
||||
public class BAS_ROLERIGHTRESOURCE
|
||||
{
|
||||
public decimal ROLEID { get; set; }
|
||||
|
||||
[Key]
|
||||
public string? RIGHTID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public decimal? TOOLBARVALUE { get; set; }
|
||||
|
||||
public virtual BAS_RIGHT? BAS_RIGHT { get; set; }
|
||||
|
||||
public virtual BAS_ROLE? BAS_ROLE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_SALESDEPARTMENT")]
|
||||
public class BAS_SALESDEPARTMENT
|
||||
{
|
||||
|
||||
[Key]
|
||||
public decimal SALEDEPTID { get; set; }
|
||||
|
||||
public decimal? COMPANYID { get; set; }
|
||||
|
||||
public string? SALEDEPTCODE { get; set; }
|
||||
|
||||
public string? DEPTNAME { get; set; }
|
||||
|
||||
public string? ADDRESS { get; set; }
|
||||
|
||||
public string? LINKNAME { get; set; }
|
||||
|
||||
public string? AREACODE { get; set; }
|
||||
|
||||
public string? PHONE { get; set; }
|
||||
|
||||
public DateTime? CREATIONDATE { get; set; }
|
||||
|
||||
public decimal? CREATIONBY { get; set; }
|
||||
|
||||
public DateTime? UPDATEDATE { get; set; }
|
||||
|
||||
public decimal? UPDATEBY { get; set; }
|
||||
|
||||
public decimal? CHANNELMIN { get; set; }
|
||||
public decimal? CHANNELMAX { get; set; }
|
||||
public decimal? CHANNELDEF { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工系统:对应的部门ID
|
||||
/// </summary>
|
||||
public decimal? DEPARTMENT_ID { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:对应的部门编码
|
||||
/// </summary>
|
||||
public string? DEPARTMENT_CODE { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:是否为业务部门, 1为业务部门,0为其他部门
|
||||
/// </summary>
|
||||
public decimal? IS_PROFESSION { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:部门的父ID
|
||||
/// </summary>
|
||||
public decimal? DEPARTMENT_PARENTID { get; set; }
|
||||
/// <summary>
|
||||
/// 员工系统:是否勾选1:是 0:否
|
||||
/// </summary>
|
||||
public decimal? ISCHECK { get; set; }
|
||||
|
||||
public decimal? DEPARTMENT_SORT { get; set; }
|
||||
|
||||
public decimal? IS_DELETED { get; set; }
|
||||
|
||||
public virtual BAS_COMPANY? BAS_COMPANY { get; set; }
|
||||
|
||||
public virtual BAS_BUSINESSDEPARTMENT? BAS_BUSINESSDEPARTMENT { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERGROUP>? BAS_INNERGROUP { get; set; }
|
||||
|
||||
public virtual List<BAS_INNERUSERGROUP>? BAS_INNERUSERGROUP { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("BAS_SUBCOMTYPE")]
|
||||
public partial class BAS_SUBCOMTYPE
|
||||
{
|
||||
[Key]
|
||||
[StringLength(50)]
|
||||
public string? SUBTYPECODE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string? SUBTYPENAME { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string? TYPECODE { get; set; }
|
||||
|
||||
[StringLength(255)]
|
||||
public string? REMARK { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public decimal? CREATEUSER { get; set; }
|
||||
|
||||
public DateTime? UTIME { get; set; }
|
||||
|
||||
public decimal? UPDATEUSER { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string? EDITFORM { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("CACHE_ORD_MEMO")]
|
||||
public class CACHE_ORD_MEMO
|
||||
{
|
||||
[Key]
|
||||
public decimal MEMOID { get; set; }
|
||||
|
||||
public decimal MTYPEID { get; set; }
|
||||
|
||||
public decimal? INNERUSERID { get; set; }
|
||||
|
||||
public decimal? MEMOCONTENTID { get; set; }
|
||||
|
||||
[StringLength(18)]
|
||||
public string RESID { get; set; }
|
||||
|
||||
public decimal? MEMOSTYLEID { get; set; }
|
||||
|
||||
public decimal? MEMOTYPEID { get; set; }
|
||||
|
||||
public decimal? MEMOSUBTYPEID { get; set; }
|
||||
|
||||
public decimal? BUSINESSID { get; set; }
|
||||
|
||||
public DateTime? CTIME { get; set; }
|
||||
|
||||
public DateTime? CALLTIME { get; set; }
|
||||
|
||||
public DateTime? CALLTIMEEND { get; set; }
|
||||
|
||||
public short? ISCHECKED { get; set; }
|
||||
|
||||
public virtual ORD_MEMOTYPE? ORD_MEMOTYPE { get; set; }
|
||||
|
||||
public virtual ORD_MEMOCONTENT? ORD_MEMOCONTENT { get; set; }
|
||||
|
||||
public virtual BAS_INNERUSER? BAS_INNERUSER { get; set; }
|
||||
|
||||
public virtual ORD_MEMOSUBTYPE? ORD_MEMOSUBTYPE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Crm.Core.Entity.Crm
|
||||
{
|
||||
[Table("CACHE_RES_RESOURCE_COUNT")]
|
||||
public class CACHE_RES_RESOURCE_COUNT
|
||||
{
|
||||
[Key]
|
||||
[StringLength(100)]
|
||||
public string RESID { get; set; }
|
||||
|
||||
public short? HASACTIVE { get; set; }
|
||||
|
||||
public short? HASBOCE { get; set; }
|
||||
|
||||
public short? HASGJS { get; set; }
|
||||
|
||||
public short? HASUSERNAME { get; set; }
|
||||
|
||||
public short? HASINAMT { get; set; }
|
||||
|
||||
public short? HASTRADE { get; set; }
|
||||
|
||||
public short? HASMEMO { get; set; }
|
||||
|
||||
public short? HASEFFECTMEMO { get; set; }
|
||||
|
||||
public decimal? ALLTRADEAMT { get; set; }
|
||||
|
||||
public decimal? ALLINAMT { get; set; }
|
||||
|
||||
public DateTime? LASTACTIVETIME { get; set; }
|
||||
public DateTime? LASTCALLTIME { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue