Tiger.Api/Controllers/WMS/WMSController.MqCustomer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Api/Controllers/WMS/WMSController.User.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business/WMS/MengQi/Biz.Mq.Customer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business/WMS/MengQi/Biz.User.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.IBusiness/WMS/MengQi/ICustomer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.IBusiness/WMS/MengQi/IUser.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Entitys/WMS/MengQi/Customer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Entitys/WMS/MengQi/User.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Tiger.Model.Net.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Tiger.Api/Controllers/WMS/WMSController.MqCustomer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,32 @@ using Microsoft.AspNetCore.Mvc; using Rhea.Common; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Api.Controllers.WMS { public partial class WMSController : ControllerBase { /// <summary> /// 客æ·ç«¯ç¨æ·ç»å½ /// </summary> /// <param name="userInfo"></param> /// <returns></returns> [HttpPost] [Route("api/[controller]/[action]")] public async Task<IActionResult> GetCustomerInfo([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<ICustomer>().GetCustomerInfo()); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } } Tiger.Api/Controllers/WMS/WMSController.User.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,32 @@ using Microsoft.AspNetCore.Mvc; using Rhea.Common; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Api.Controllers.WMS { public partial class WMSController : ControllerBase { /// <summary> /// 客æ·ç«¯ç¨æ·ç»å½ /// </summary> /// <param name="userInfo"></param> /// <returns></returns> [HttpPost] [Route("api/[controller]/[action]")] public async Task<IActionResult> Login(User userInfo) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<IUser>().Login(userInfo)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } } Tiger.Business/WMS/MengQi/Biz.Mq.Customer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,45 @@ using Rhea.Common; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Business { public partial class Biz { /// <summary> /// å®¢æ· /// </summary> public partial class MqCustomer : ICustomer { /// <summary> /// è·å客æ·ä¿¡æ¯ /// </summary> /// <returns></returns> public async Task<ApiAction<List<Customer>>> GetCustomerInfo() { var res = new ApiAction<List<Customer>>(); try { List<Customer> result = await Db.Queryable<Customer>().ToListAsync(); res.Data = result; } catch (Exception ex) { res.CatchExceptionWithLog(ex, "è·å客æ·ä¿¡æ¯å¼å¸¸"); } return res; } public async Task<Result> SaveImportCustomerInfo(DataTable dt) { throw new NotImplementedException(); } } } } Tiger.Business/WMS/MengQi/Biz.User.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,110 @@ using Rhea.Common; using SqlSugar; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Business { public partial class Biz { /// <summary> /// ç¨æ· /// </summary> public partial class Users : IUser { /// <summary> /// è·åç¨æ·ä¿¡æ¯ /// </summary> /// <param name="pageList"></param> /// <returns></returns> /// <exception cref="NotImplementedException"></exception> public async Task<PageAble<User>> GetUserInfo(PageAble<User> pageList) { RefAsync<int> total = 0; pageList.data = await Db.Queryable<User>().WhereIF(!string.IsNullOrEmpty(pageList.sqlcmd), x => x.UserCode.Contains(pageList.sqlcmd)).ToPageListAsync(pageList.pageIndex, pageList.pageSize, total); pageList.totals = total; return pageList; } /// <summary> /// ç¨æ·ç»å½ /// </summary> /// <param name="userInfo"></param> /// <returns></returns> public async Task<ApiAction<User>> Login(User userInfo) { var res = new ApiAction<User>(); try { string usercode = userInfo.UserCode; if (userInfo.UserCode == "åè´¨ç¨æ·") { var user = await Db.Queryable<User>().Where(x => x.RoleCode == "åè´¨").FirstAsync(); if (user != null) { usercode = user.UserCode; } } if (!Db.Queryable<User>().Where(x => x.UserCode == usercode && x.Password == userInfo.Password).Any()) { //result = new(Result.Flags.Failed, "ç¨æ·æ²¡ææéæè ç¨æ·ååå¯ç é误ï¼"); userInfo = new(); } else { userInfo = await Db.Queryable<User>().Where(x => x.UserCode == usercode && x.Password == userInfo.Password).FirstAsync(); } res.Data = userInfo; } catch (Exception ex) { res.CatchExceptionWithLog(ex, "ç»å½å¼å¸¸"); } return res; } /// <summary> /// /// </summary> /// <param name="dt"></param> /// <returns></returns> public async Task<Result> SaveImportUserInfo(DataTable dt) { Result result = new Result(Result.Flags.Success, $"å¯¼å ¥æå"); List<User> list = new(); for (int i = 0; i < dt.Rows.Count; i++) { User item = new() { id = Guid.NewGuid().ToString("N"), UserCode = dt.Rows[i]["ç¨æ·ID"].ToString(), UserName = dt.Rows[i]["ç¨æ·åç§°"].ToString(), RoleCode = dt.Rows[i]["ç¨æ·è§è²"].ToString(), }; var info = Db.Queryable<User>().Where(x => x.UserCode == dt.Rows[i]["ç¨æ·ID"].ToString()).First(); if (info != null) { item.id = info.id; } list.Add(item); } //æ´æ°æºåè®°å½ var db = Db; var dbTran = await db.UseTranAsync(async () => { await db.Saveable(list).ExecuteCommandAsync(); }); if (!dbTran.IsSuccess) { result.Flag = Result.Flags.Failed; result.Message = $"å¯¼å ¥å¼å¸¸"; } return result; } } } } Tiger.IBusiness/WMS/MengQi/ICustomer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ using Rhea.Common; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.Model; namespace Tiger.IBusiness { public interface ICustomer { public Task<ApiAction<List<Customer>>> GetCustomerInfo(); public Task<Result> SaveImportCustomerInfo(DataTable dt); } } Tiger.IBusiness/WMS/MengQi/IUser.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,18 @@ using Rhea.Common; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.Model; namespace Tiger.IBusiness { public interface IUser { public Task<PageAble<User>> GetUserInfo(PageAble<User> pageList); public Task<Result> SaveImportUserInfo(DataTable dt); public Task<ApiAction<User>> Login(User userInfo); } } Tiger.Model.Net/Entitys/WMS/MengQi/Customer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,124 @@ using SqlSugar; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tiger.Model { [Serializable] [Description("Primary:")] [SugarTable("Customer")] public class Customer { private string _id = null; private string _customercode = null; private string _customername = null; private string _Prefix = null; private int _SnLength = 0; private string _Separator = null; private int _SeparatorNum = 0; private string _remark = null; [SugarColumn(IsPrimaryKey = true)] public string id { get { return _id; } set { _id = value; } } public string CustomerCode { get { return _customercode; } set { _customercode = value; } } public string CustomerName { get { return _customername; } set { _customername = value; } } public string Prefix { get { return _Prefix; } set { _Prefix = value; } } public int SnLength { get { return _SnLength; } set { _SnLength = value; } } public string Separator { get { return _Separator; } set { _Separator = value; } } public int SeparatorNum { get { return _SeparatorNum; } set { _SeparatorNum = value; } } public string Remark { get { return _remark; } set { _remark = value; } } } } Tiger.Model.Net/Entitys/WMS/MengQi/User.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,88 @@ using SqlSugar; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tiger.Model { [Serializable] [Description("Primary:")] [SugarTable("User")] public class User { private string _id = null; private string _usercode = null; private string _username = null; private string _rolecode = null; private string _password = null; [SugarColumn(IsPrimaryKey = true)] public string id { get { return _id; } set { _id = value; } } public string UserCode { get { return _usercode; } set { _usercode = value; } } public string UserName { get { return _username; } set { _username = value; } } public string RoleCode { get { return _rolecode; } set { _rolecode = value; } } public string Password { get { return _password; } set { _password = value; } } } } Tiger.Model.Net/Tiger.Model.Net.csproj
@@ -102,6 +102,8 @@ <Compile Include="Entitys\WMS\Api\ProdReqInput.cs" /> <Compile Include="Entitys\WMS\Api\ReprintEntitys.cs" /> <Compile Include="Entitys\WMS\BIZ_ERP_CUSTOMS.cs" /> <Compile Include="Entitys\WMS\MengQi\Customer.cs" /> <Compile Include="Entitys\WMS\MengQi\User.cs" /> <Compile Include="Entitys\WMS\V_MONTH_IN_SUM.cs" /> <Compile Include="Entitys\WMS\V_WH_ITEM_SUM.cs" /> <Compile Include="Entitys\WMS\V_WMS_ITEM_Y.cs" />