Commit c93aa1d4 authored by 黄奎's avatar 黄奎

页面修改

parent cccb7075
...@@ -170,6 +170,25 @@ namespace Mall.Module.User ...@@ -170,6 +170,25 @@ namespace Mall.Module.User
return employeeRepository.GetEmployeeListRepository(query); return employeeRepository.GetEmployeeListRepository(query);
} }
/// <summary>
/// 判断账号是否存在
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public bool CheckExistsEmployeeModule(RB_Employee_Extend query)
{
List<WhereHelper> list = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Employee_Extend.EmpAccount),query.EmpAccount.Trim()),
};
if (query.EmpId > 0)
{
list.Add(new WhereHelper(nameof(RB_Employee_Extend.EmpId), query.EmpId, operatorEnum: OperatorEnum.NotEqual));
}
bool flag= employeeRepository.Exists(list);
return flag;
}
/// <summary> /// <summary>
/// 新增修改员工 /// 新增修改员工
/// </summary> /// </summary>
......
...@@ -60,7 +60,7 @@ namespace Mall.Repository.User ...@@ -60,7 +60,7 @@ namespace Mall.Repository.User
builder.Append(@" builder.Append(@"
SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
,A.AccountStatus,B.EmpPwd AS Password,B.EmpId ,A.AccountStatus,B.EmpPwd AS Password,B.EmpId
FROM RB_Tenant AS A LEFT JOIN rb_employee AS B ON A.TenantId=B.TenantId FROM RB_Tenant AS A INNER JOIN rb_employee AS B ON A.TenantId=B.TenantId
WHERE 1=1 "); WHERE 1=1 ");
if (query != null) if (query != null)
{ {
......
...@@ -8,6 +8,7 @@ using Mall.Common.Plugin; ...@@ -8,6 +8,7 @@ using Mall.Common.Plugin;
using Mall.Model.Extend.BaseSetUp; using Mall.Model.Extend.BaseSetUp;
using Mall.Module.BaseSetUp; using Mall.Module.BaseSetUp;
using Mall.WebApi.Filter; using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
...@@ -31,17 +32,18 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -31,17 +32,18 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary> /// </summary>
/// <param name="ParentID">父节点编号</param> /// <param name="ParentID">父节点编号</param>
/// <returns></returns> /// <returns></returns>
[AllowAnonymous]
public ApiResult GetChildList() public ApiResult GetChildList()
{ {
JObject parm = JObject.Parse(RequestParm.msg.ToString()); JObject parm = JObject.Parse(RequestParm.msg.ToString());
int ID = parm.GetInt("Id"); int ID = parm.GetInt("Id");
if (ID > 0) if (ID > 0)
{ {
var CommonList = Mall.Common.Data.AreaDataHelper.GetAreaList(); //var CommonList = Mall.Common.Data.AreaDataHelper.GetAreaList();
if (CommonList != null && CommonList.Count > 0) //if (CommonList != null && CommonList.Count > 0)
{ //{
return ApiResult.Success("", CommonList.Where(qitem => qitem.P == ID).Select(qitem => new { ID = qitem.I, Name = qitem.N })); // return ApiResult.Success("", CommonList.Where(qitem => qitem.P == ID).Select(qitem => new { ID = qitem.I, Name = qitem.N }));
} //}
var list = destinationModule.GetChildList(ID).Select(item => new { item.ID, item.Name }); var list = destinationModule.GetChildList(ID).Select(item => new { item.ID, item.Name });
return ApiResult.Success("", list); return ApiResult.Success("", list);
} }
......
...@@ -14,7 +14,9 @@ using Newtonsoft.Json.Linq; ...@@ -14,7 +14,9 @@ using Newtonsoft.Json.Linq;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using Mall.Model.Extend.MarketingCenter; using Mall.Model.Extend.MarketingCenter;
using Mall.Module.BaseSetUp; using Mall.Module.BaseSetUp;
using Mall.Common;
using Mall.CacheManager.User;
using Microsoft.AspNetCore.Authorization;
namespace Mall.WebApi.Controllers.User namespace Mall.WebApi.Controllers.User
{ {
...@@ -145,10 +147,21 @@ namespace Mall.WebApi.Controllers.User ...@@ -145,10 +147,21 @@ namespace Mall.WebApi.Controllers.User
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[AllowAnonymous]
public ApiResult SetUserShippingAddress() public ApiResult SetUserShippingAddress()
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo; JObject prams = JObject.Parse(req.msg.ToString());
int NewUserId = prams.GetInt("NewUserId");
AppletUserInfo userInfo =null;
if (NewUserId > 0)
{
userInfo = UserReidsCache.GetAppletUserLoginInfo(NewUserId);
}
else
{
userInfo = AppletUserInfo;
}
RB_Member_ShippingAddress_Extend demodel = JsonConvert.DeserializeObject<RB_Member_ShippingAddress_Extend>(req.msg.ToString()); RB_Member_ShippingAddress_Extend demodel = JsonConvert.DeserializeObject<RB_Member_ShippingAddress_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name)) if (string.IsNullOrEmpty(demodel.Name))
{ {
......
...@@ -155,6 +155,10 @@ namespace Mall.WebApi.Controllers.User ...@@ -155,6 +155,10 @@ namespace Mall.WebApi.Controllers.User
extModel.TenantId = RequestParm.TenantId; extModel.TenantId = RequestParm.TenantId;
extModel.CreateDate = DateTime.Now; extModel.CreateDate = DateTime.Now;
extModel.EmpPwd = Common.DES.Encrypt(extModel.EmpPwd, Common.Config.WebApiKey, Common.Config.WebApiIV); extModel.EmpPwd = Common.DES.Encrypt(extModel.EmpPwd, Common.Config.WebApiKey, Common.Config.WebApiIV);
if (module.CheckExistsEmployeeModule(extModel))
{
return ApiResult.Failed("此账号【" + extModel.EmpAccount + "】已存在,请重新填写账号!");
}
var flag = module.SetEmployeeModule(extModel); var flag = module.SetEmployeeModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment