| | |
| | | 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; |
| | |
| | | private readonly ICoreCmsUserPointLogServices _coreCmsUserPointLogServices; |
| | | private readonly ICoreCmsUserServices _coreCmsUserServices; |
| | | private readonly IWebHostEnvironment _webHostEnvironment; |
| | | private readonly IHttpContextUser _httpContextUser; |
| | | private readonly IapplyModelServices _applyModelServices; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// <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; |
| | |
| | | _coreCmsUserGradeServices = coreCmsUserGradeServices; |
| | | _coreCmsUserBalanceServices = coreCmsUserBalanceServices; |
| | | _coreCmsUserPointLogServices = coreCmsUserPointLogServices; |
| | | _httpContextUser = httpContextUser; |
| | | _applyModelServices = applyModelServices; |
| | | } |
| | | |
| | | #region 获取列表============================================================ |
| | |
| | | [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; |
| | | } |
| | | |
| | |
| | | [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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |