From 5b46930255ec185a906d07165f9d0dc91c300ab8 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 02 四月 2024 10:56:30 +0800
Subject: [PATCH] 提交
---
CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs | 121 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 116 insertions(+), 5 deletions(-)
diff --git a/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs b/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs
index 3f2a814..d4b76cf 100644
--- a/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs
+++ b/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserController.cs
@@ -14,13 +14,16 @@
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
+using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.Filter;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
+using CoreCms.Net.Model.Entities.baifenbingfa.apply;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
+using CoreCms.Net.Services;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.Web.Admin.Infrastructure;
@@ -47,6 +50,8 @@
private readonly ICoreCmsUserPointLogServices _coreCmsUserPointLogServices;
private readonly ICoreCmsUserServices _coreCmsUserServices;
private readonly IWebHostEnvironment _webHostEnvironment;
+ private readonly IHttpContextUser _httpContextUser;
+ private readonly IapplyModelServices _applyModelServices;
/// <summary>
@@ -57,12 +62,16 @@
/// <param name="coreCmsUserGradeServices"></param>
/// <param name="coreCmsUserBalanceServices"></param>
/// <param name="coreCmsUserPointLogServices"></param>
+ /// <param name="httpContextUser"></param>
+ /// <param name="applyModelServices"></param>
public CoreCmsUserController(
IWebHostEnvironment webHostEnvironment
, ICoreCmsUserServices coreCmsUserServices
, ICoreCmsUserGradeServices coreCmsUserGradeServices
, ICoreCmsUserBalanceServices coreCmsUserBalanceServices
, ICoreCmsUserPointLogServices coreCmsUserPointLogServices
+ , IHttpContextUser httpContextUser
+ , IapplyModelServices applyModelServices
)
{
_webHostEnvironment = webHostEnvironment;
@@ -70,6 +79,8 @@
_coreCmsUserGradeServices = coreCmsUserGradeServices;
_coreCmsUserBalanceServices = coreCmsUserBalanceServices;
_coreCmsUserPointLogServices = coreCmsUserPointLogServices;
+ _httpContextUser = httpContextUser;
+ _applyModelServices = applyModelServices;
}
#region 鑾峰彇鍒楄〃============================================================
@@ -994,7 +1005,43 @@
[Description("淇敼浣欓鎻愪氦")]
public async Task<AdminUiCallBack> DoEditBalance([FromBody] FMUpdateUserBalance entity)
{
- var jm = await _coreCmsUserServices.UpdateBalance(entity.id, entity.balance, entity.memo);
+ var jm = new AdminUiCallBack();
+ var model = await _coreCmsUserServices.QueryByIdAsync(entity.id);
+ if (model == null)
+ {
+ jm.msg = "涓嶅瓨鍦ㄦ淇℃伅";
+ return jm;
+ }
+ var id = _httpContextUser.ID;
+ var name = _httpContextUser.Name;
+
+ applyModel entity1 = new applyModel();
+ //entity1.id = 0;
+ entity1.managerID = null;
+ entity1.roleID = "shenpi";
+ entity1.managerApplyCount = 2;
+
+ entity1.aType = applyType.Balance;
+ entity1.ayStataType = applyStataType.applying;
+ entity1.userID = entity.id;
+ entity1.dec = "鐢ㄦ埛"+ model.nickName + "浣欓璋冩暣";
+ entity1.reMake = entity.memo;
+ entity1.oldData = entity.oldbalance+"";
+ entity1.data = entity.balance+"";
+ entity1.createTime = DateTime.Now;
+ entity1.upDataTime = entity1.createTime;
+ entity1.createBy = name;
+ entity1.upDataBy = name;
+ entity1.createById = id;
+ entity1.upDataById = id;
+ entity1.isdelete = false;
+
+ jm = await _applyModelServices.InsertAsync(entity1);
+
+
+
+ // var jm = await _coreCmsUserServices.UpdateBalance(entity.id, entity.balance, entity.memo);
+ jm.msg = "鏁版嵁鎻愪氦瀹℃牳鎴愬姛";
return jm;
}
@@ -1041,7 +1088,41 @@
[Description("淇敼绉垎鎻愪氦")]
public async Task<AdminUiCallBack> DoEditPoint([FromBody] FMUpdateUserPoint entity)
{
- var jm = await _coreCmsUserServices.UpdatePiont(entity);
+ var jm = new AdminUiCallBack();
+ var model = await _coreCmsUserServices.QueryByIdAsync(entity.id);
+ if (model == null)
+ {
+ jm.msg = "涓嶅瓨鍦ㄦ淇℃伅";
+ return jm;
+ }
+
+ var id = _httpContextUser.ID;
+ var name = _httpContextUser.Name;
+
+ applyModel entity1 = new applyModel();
+ //entity1.id = 0;
+ entity1.managerID = null;
+ entity1.roleID = "shenpi";
+ entity1.managerApplyCount = 2;
+
+ entity1.aType = applyType.points;
+ entity1.ayStataType = applyStataType.applying;
+ entity1.userID = entity.id;
+ entity1.dec = "鐢ㄦ埛" + model.nickName + "绉垎璋冩暣";
+ entity1.reMake = entity.memo;
+ entity1.oldData = entity.oldpoint + "";
+ entity1.data = entity.point + "";
+ entity1.createTime = DateTime.Now;
+ entity1.upDataTime = entity1.createTime;
+ entity1.createBy = name;
+ entity1.upDataBy = name;
+ entity1.createById = id;
+ entity1.upDataById = id;
+ entity1.isdelete = false;
+
+ jm = await _applyModelServices.InsertAsync(entity1);
+ jm.msg = "鏁版嵁鎻愪氦瀹℃牳鎴愬姛";
+ // var jm = await _coreCmsUserServices.UpdatePiont(entity);
return jm;
}
@@ -1137,10 +1218,40 @@
entity.parentId = 0;
}
- var bl = await _coreCmsUserServices.UpdateAsync(p => new CoreCmsUser() { parentId = entity.parentId }, p => p.id == model.id);
+ // var bl = await _coreCmsUserServices.UpdateAsync(p => new CoreCmsUser() { parentId = entity.parentId }, p => p.id == model.id);
- jm.code = bl ? 0 : 1;
- jm.msg = bl ? "鏇存柊鎴愬姛" : "鏇存柊澶辫触";
+
+ var id = _httpContextUser.ID;
+ var name = _httpContextUser.Name;
+
+ applyModel entity1 = new applyModel();
+ //entity1.id = 0;
+ entity1.managerID = null;
+ entity1.roleID = "shenpi";
+ entity1.managerApplyCount = 2;
+
+ entity1.aType = applyType.Referrer;
+ entity1.ayStataType = applyStataType.applying;
+ entity1.userID = entity.id;
+ entity1.dec = "鐢ㄦ埛" + model.nickName + "鎺ㄨ崘浜鸿皟鏁�";
+ entity1.reMake = "";
+ entity1.oldData = entity.oldparentId + "";
+ entity1.data = entity.parentId + "";
+ entity1.createTime = DateTime.Now;
+ entity1.upDataTime = entity1.createTime;
+ entity1.createBy = name;
+ entity1.upDataBy = name;
+ entity1.createById = id;
+ entity1.upDataById = id;
+ entity1.isdelete = false;
+
+ jm = await _applyModelServices.InsertAsync(entity1);
+
+ jm.msg = "鏁版嵁鎻愪氦瀹℃牳鎴愬姛";
+
+
+
+
return jm;
}
--
Gitblit v1.9.1