diff --git a/EFCoreDatabase/Data/DmDBContext.cs b/EFCoreDatabase/Data/DmDBContext.cs index 22e720e..1f3345c 100644 --- a/EFCoreDatabase/Data/DmDBContext.cs +++ b/EFCoreDatabase/Data/DmDBContext.cs @@ -27,12 +27,23 @@ namespace EFCoreDatabase.Data public DbSet Goods_Main { get; set; } + public DbSet Plan_main { get; set; } + public DbSet Plan_list { get; set; } + public virtual DbSet V_Storage_List { get; set; } + public virtual DbSet V_Manage { get; set; } + + public DbSet Wh_warehouse { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) { //定义视图无主键 modelBuilder.Entity().HasNoKey(); + modelBuilder.Entity().HasNoKey(); + + modelBuilder.Entity(x => x.Property(e => e.WEIGHT_EMPTY_BUCKET).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_RUBBER).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.MANAGE_LIST_QUANTITY).HasColumnType("decimal")); @@ -43,6 +54,20 @@ namespace EFCoreDatabase.Data modelBuilder.Entity(x => x.Property(e => e.WEIGHT_RUBBER).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.MANAGE_LIST_QUANTITY).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.STORAGE_LIST_QUANTITY).HasColumnType("decimal")); + + //tlt添加序列和自增ID属性 + modelBuilder.Entity().HasKey(x => x.GOODS_ID);//定义主键 + modelBuilder.Entity().Property(e => e.GOODS_ID).UseHiLo("GOODS_MAIN_SEQ");//定义主键序列 + + modelBuilder.Entity().HasKey(x => x.PLAN_ID);//定义主键 + modelBuilder.Entity().Property(e => e.PLAN_ID).UseHiLo("PLAN_MAIN_SEQ");//定义主键序列 + + modelBuilder.Entity().HasKey(x => x.PLAN_LIST_ID);//定义主键 + modelBuilder.Entity().Property(e => e.PLAN_LIST_ID).UseHiLo("PLAN_LIST_SEQ");//定义主键序列 + + modelBuilder.Entity().HasKey(x => x.WAREHOUSE_ID);//定义主键 + modelBuilder.Entity().Property(e => e.WAREHOUSE_ID).UseHiLo("WAREHOUSE_ID_SEQ");//定义主键序列 + } diff --git a/EFCoreDatabase/EFCoreDatabase.csproj b/EFCoreDatabase/EFCoreDatabase.csproj index 6e9f599..b585e88 100644 --- a/EFCoreDatabase/EFCoreDatabase.csproj +++ b/EFCoreDatabase/EFCoreDatabase.csproj @@ -6,11 +6,6 @@ enable - - - - - diff --git a/EFCoreDatabase/Entities/PLAN_LIST.cs b/EFCoreDatabase/Entities/PLAN_LIST.cs new file mode 100644 index 0000000..3ad3b60 --- /dev/null +++ b/EFCoreDatabase/Entities/PLAN_LIST.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreDatabase.Entities; + + +[Table("PLAN_LIST")] +public class PLAN_LIST +{ + [Column("PLAN_LIST_ID")] + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int PLAN_LIST_ID { get; set; } + + [Column("PLAN_ID")] + public int PLAN_ID { get; set; } + + [Column("PLAN_LIST_CODE")] + public string? PLAN_LIST_CODE { get; set; } + + [Column("PLAN_LIST_QUANTITY")] + public int? PLAN_LIST_QUANTITY { get; set; } + + [Column("PLAN_LIST_ORDERED_QUANTITY")] + public int? PLAN_LIST_ORDERED_QUANTITY { get; set; } + + [Column("PLAN_LIST_FINISHED_QUANTITY")] + public int? PLAN_LIST_FINISHED_QUANTITY { get; set; } + + [Column("GOODS_ID")] + public int? GOODS_ID { get; set; } + + [Column("GOODS_PROPERTY1")] + public string? GOODS_PROPERTY1 { get; set; } + + [Column("GOODS_PROPERTY2")] + public string? GOODS_PROPERTY2 { get; set; } + + [Column("GOODS_PROPERTY3")] + public string? GOODS_PROPERTY3 { get; set; } + + [Column("GOODS_PROPERTY4")] + public string? GOODS_PROPERTY4 { get; set; } + + [Column("GOODS_PROPERTY5")] + public string? GOODS_PROPERTY5 { get; set; } + + [Column("GOODS_PROPERTY6")] + public string? GOODS_PROPERTY6 { get; set; } + + [Column("GOODS_PROPERTY7")] + public string? GOODS_PROPERTY7 { get; set; } + + [Column("GOODS_PROPERTY8")] + public string? GOODS_PROPERTY8 { get; set; } + + [Column("PLAN_LIST_REMARK")] + public string? PLAN_LIST_REMARK { get; set; } + + + + +} \ No newline at end of file diff --git a/EFCoreDatabase/Entities/PLAN_MAIN.cs b/EFCoreDatabase/Entities/PLAN_MAIN.cs new file mode 100644 index 0000000..000ad89 --- /dev/null +++ b/EFCoreDatabase/Entities/PLAN_MAIN.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreDatabase.Entities; + + +[Table("PLAN_MAIN")] +public class PLAN_MAIN +{ + /// + /// 自增ID + /// + [Column("PLAN_ID")] + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int PLAN_ID { get; set; } + + [Column("PLAN_RELATIVE_ID")] + public int? PLAN_RELATIVE_ID { get; set; } + + [Column("PLAN_CODE")] + public string? PLAN_CODE { get; set; } + + [Column("PLAN_TYPE_CODE")] + public string? PLAN_TYPE_CODE { get; set; } + + [Column("PLAN_CREATE_TIME")] + public string? PLAN_CREATE_TIME { get; set; } + + [Column("PLAN_BEGIN_TIME")] + public string? PLAN_BEGIN_TIME { get; set; } + + [Column("PLAN_END_TIME")] + public string? PLAN_END_TIME { get; set; } + + [Column("PLAN_BILL_DATE")] + public string? PLAN_BILL_DATE { get; set; } + + [Column("PLAN_STATUS")] + public string? PLAN_STATUS { get; set; } + + [Column("PLAN_CREATOR")] + public string? PLAN_CREATOR { get; set; } + + [Column("PLAN_FROM_DEPT")] + public string? PLAN_FROM_DEPT { get; set; } + + [Column("PLAN_TO_DEPT")] + public string? PLAN_TO_DEPT { get; set; } + + [Column("PLAN_FROM_USER")] + public string? PLAN_FROM_USER { get; set; } + + [Column("PLAN_TO_USER")] + public string? PLAN_TO_USER { get; set; } + + [Column("PLAN_REMARK")] + public string? PLAN_REMARK { get; set; } + + [Column("PLAN_FLAG")] + public string? PLAN_FLAG { get; set; } + + [Column("PLAN_CONFIRM_TIME")] + public string? PLAN_CONFIRM_TIME { get; set; } + + [Column("PLAN_CONFIRM_USER")] + public string? PLAN_CONFIRM_USER { get; set; } + +} \ No newline at end of file diff --git a/EFCoreDatabase/Entities/V_MANAGE.cs b/EFCoreDatabase/Entities/V_MANAGE.cs new file mode 100644 index 0000000..dedff40 --- /dev/null +++ b/EFCoreDatabase/Entities/V_MANAGE.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreDatabase.Entities; + +[Table("V_MANAGE")] +public class V_MANAGE +{ + [Column("MANAGE_ID")] + public int? MANAGE_ID { get; set; } + [Column("MANAGE_TYPE_ID")] + public int? MANAGE_TYPE_ID { get; set; } + [Column("MANAGE_TYPE_CODE")] + public string? MANAGE_TYPE_CODE { get; set; } + [Column("MANAGE_TYPE_NAME")] + public string? MANAGE_TYPE_NAME { get; set; } + [Column("MANAGE_STATUS")] + public string? MANAGE_STATUS { get; set; } + [Column("STOCK_BARCODE")] + public string? STOCK_BARCODE { get; set; } + [Column("START_POSITION")] + public string? START_POSITION { get; set; } + [Column("END_POSITION")] + public string? END_POSITION { get; set; } + [Column("MANAGE_OPERATOR")] + public string? MANAGE_OPERATOR { get; set; } + [Column("MANAGE_BEGIN_TIME")] + public string? MANAGE_BEGIN_TIME { get; set; } + [Column("MANAGE_END_TIME")] + public string? MANAGE_END_TIME { get; set; } + [Column("MANAGE_REMARK")] + public string? MANAGE_REMARK { get; set; } +} \ No newline at end of file diff --git a/EFCoreDatabase/Entities/WH_WAREHOUSE.cs b/EFCoreDatabase/Entities/WH_WAREHOUSE.cs new file mode 100644 index 0000000..cfa0d0a --- /dev/null +++ b/EFCoreDatabase/Entities/WH_WAREHOUSE.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreDatabase.Entities; + +[Table("WH_WAREHOUSE")] +public class WH_WAREHOUSE +{ + [Column("WAREHOUSE_ID")] + public int WAREHOUSE_ID { get; set; } + + [Column("WAREHOUSE_CODE")] + public string WAREHOUSE_CODE { get; set; } + + [Column("WAREHOUSE_NAME")] + public string WAREHOUSE_NAME { get; set; } + [Column("WAREHOUSE_FLAG")] + public string WAREHOUSE_FLAG { get; set; } + [Column("WAREHOUSE_TYPE")] + public string WAREHOUSE_TYPE { get; set; } + [Column("WAREHOUSE_ORDER")] + public int WAREHOUSE_ORDER { get; set; } +} \ No newline at end of file diff --git a/EFCoreDatabase/Repositories/Implement/GoodsRepository.cs b/EFCoreDatabase/Repositories/Implement/GoodsRepository.cs index 0f383e4..8d7bf00 100644 --- a/EFCoreDatabase/Repositories/Implement/GoodsRepository.cs +++ b/EFCoreDatabase/Repositories/Implement/GoodsRepository.cs @@ -35,6 +35,19 @@ namespace EFCoreDatabase.Repositories.Implement return goodsMains; } + public bool UpdateGoodsMain(GOODS_MAIN goodsMain) + { + if (goodsMain == null) + { + throw new ArgumentNullException(nameof(goodsMain)); + } + + _context.Goods_Main.Update(goodsMain); + _context.SaveChanges(); + return true; + + } + public bool AddGoodsMain(GOODS_MAIN goodsMain) { if (goodsMain == null) diff --git a/EFCoreDatabase/Repositories/Implement/ManageRepository.cs b/EFCoreDatabase/Repositories/Implement/ManageRepository.cs index 9bcdfd7..5a09f65 100644 --- a/EFCoreDatabase/Repositories/Implement/ManageRepository.cs +++ b/EFCoreDatabase/Repositories/Implement/ManageRepository.cs @@ -54,10 +54,16 @@ namespace EFCoreDatabase.Repositories.Implement public List GetManageMains() { //var manageManageLists = _context.Manage_Main.ToList(); - var manageManageLists = _context.Manage_Main.FromSqlRaw("select * from MANAGE_MAIN").ToList(); + var manageManageLists = _context.Manage_Main.FromSqlRaw("select * from( select * from MANAGE_MAIN) where rownum < 2").ToList(); return manageManageLists; } + public List? GetVManages() + { + var vManageList = _context.V_Manage.FromSqlRaw("select * from V_MANAGE").ToList(); + return vManageList; + } + /// /// 添加manageMain /// diff --git a/EFCoreDatabase/Repositories/Implement/PlanRepository.cs b/EFCoreDatabase/Repositories/Implement/PlanRepository.cs new file mode 100644 index 0000000..e8f2b99 --- /dev/null +++ b/EFCoreDatabase/Repositories/Implement/PlanRepository.cs @@ -0,0 +1,36 @@ +using System.Security.Cryptography.X509Certificates; +using EFCoreDatabase.Data; +using EFCoreDatabase.Entities; +using EFCoreDatabase.Repositories.Interface; +using Microsoft.Extensions.Logging; + +namespace EFCoreDatabase.Repositories.Implement; + +public class PlanRepository(DmDBContext context, ILogger logger) : IPlanRepository +{ + private readonly DmDBContext _context = context; + private readonly ILogger _logger = logger; + + /// + /// 获取planMain的列表 + /// + /// + /// + public List GetPlanMainByInPut() + { + string[] planInTypeEnum = ["PlanIn", "PlanOtherIn","PlanReworkIn"]; + var planMainList = _context.Plan_main.Where(x=> x.PLAN_STATUS =="Waiting" && planInTypeEnum.Contains(x.PLAN_TYPE_CODE)).ToList(); + + return planMainList; + } + + public List GetLists(int planId) + { + var planListList = _context.Plan_list.Where(x => x.PLAN_ID == planId).ToList(); + return planListList; + } + + + + +} \ No newline at end of file diff --git a/EFCoreDatabase/Repositories/Implement/WhCellRepository.cs b/EFCoreDatabase/Repositories/Implement/WhCellRepository.cs index c9ae40a..6d3fd63 100644 --- a/EFCoreDatabase/Repositories/Implement/WhCellRepository.cs +++ b/EFCoreDatabase/Repositories/Implement/WhCellRepository.cs @@ -35,5 +35,11 @@ namespace EFCoreDatabase.Repositories.Implement return true; } + + public List? GetWarehouses() + { + var warehouseList = _context.Wh_warehouse.Where(x => x.WAREHOUSE_FLAG == "1").ToList(); + return warehouseList; + } } } \ No newline at end of file diff --git a/EFCoreDatabase/Repositories/Interface/IGoodsRepository.cs b/EFCoreDatabase/Repositories/Interface/IGoodsRepository.cs index ae6c1e3..1e760ea 100644 --- a/EFCoreDatabase/Repositories/Interface/IGoodsRepository.cs +++ b/EFCoreDatabase/Repositories/Interface/IGoodsRepository.cs @@ -14,5 +14,7 @@ namespace EFCoreDatabase.Repositories.Interface public bool AddGoodsMain(GOODS_MAIN goodsMain); public List GetGoodsMains(); + + public bool UpdateGoodsMain(GOODS_MAIN goodsMain); } } diff --git a/EFCoreDatabase/Repositories/Interface/IManageRepository.cs b/EFCoreDatabase/Repositories/Interface/IManageRepository.cs index 556a688..5f979f9 100644 --- a/EFCoreDatabase/Repositories/Interface/IManageRepository.cs +++ b/EFCoreDatabase/Repositories/Interface/IManageRepository.cs @@ -16,5 +16,7 @@ namespace EFCoreDatabase.Repositories.Interface public List GetManageList(int manageId); public bool AddManageList(MANAGE_LIST manageList); public List GetManageMains(); + + public List? GetVManages(); } } \ No newline at end of file diff --git a/EFCoreDatabase/Repositories/Interface/IPlanRepository.cs b/EFCoreDatabase/Repositories/Interface/IPlanRepository.cs new file mode 100644 index 0000000..f66b2f8 --- /dev/null +++ b/EFCoreDatabase/Repositories/Interface/IPlanRepository.cs @@ -0,0 +1,9 @@ +using EFCoreDatabase.Entities; + +namespace EFCoreDatabase.Repositories.Interface; + +public interface IPlanRepository +{ + public List GetPlanMainByInPut(); + public List GetLists(int planId); +} \ No newline at end of file diff --git a/EFCoreDatabase/Repositories/Interface/IWhCellRepository.cs b/EFCoreDatabase/Repositories/Interface/IWhCellRepository.cs index 08f72be..53a0a07 100644 --- a/EFCoreDatabase/Repositories/Interface/IWhCellRepository.cs +++ b/EFCoreDatabase/Repositories/Interface/IWhCellRepository.cs @@ -6,5 +6,7 @@ namespace EFCoreDatabase.Repositories.Interface { public WH_CELL GetCell(int cellId); public bool UpdateCellStatus(WH_CELL whCell); + + public List? GetWarehouses(); } } \ No newline at end of file diff --git a/NewProjectApp.sln b/NewProjectApp.sln index c10e694..b5db9b2 100644 --- a/NewProjectApp.sln +++ b/NewProjectApp.sln @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NewWMSProject.Client", "New EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EFCoreDatabase", "EFCoreDatabase\EFCoreDatabase.csproj", "{4F4AB9A0-0A0F-4DDC-AB03-D7F04244EE01}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NewWMSWebAPI", "NewWMSWebAPI\NewWMSWebAPI.csproj", "{D4207F17-DA35-4727-ABA2-16FD8FAEA1E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {4F4AB9A0-0A0F-4DDC-AB03-D7F04244EE01}.Debug|Any CPU.Build.0 = Debug|Any CPU {4F4AB9A0-0A0F-4DDC-AB03-D7F04244EE01}.Release|Any CPU.ActiveCfg = Release|Any CPU {4F4AB9A0-0A0F-4DDC-AB03-D7F04244EE01}.Release|Any CPU.Build.0 = Release|Any CPU + {D4207F17-DA35-4727-ABA2-16FD8FAEA1E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4207F17-DA35-4727-ABA2-16FD8FAEA1E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4207F17-DA35-4727-ABA2-16FD8FAEA1E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4207F17-DA35-4727-ABA2-16FD8FAEA1E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NewWMSProject/src/NewWMSProject.Client/Layouts/BasicLayout.razor.cs b/NewWMSProject/src/NewWMSProject.Client/Layouts/BasicLayout.razor.cs index 6bd3f9f..b3ae924 100644 --- a/NewWMSProject/src/NewWMSProject.Client/Layouts/BasicLayout.razor.cs +++ b/NewWMSProject/src/NewWMSProject.Client/Layouts/BasicLayout.razor.cs @@ -27,7 +27,7 @@ namespace NewWMSProject.Layouts Path = "/material", Name = "物料信息", Key = "material", - Icon = "task", + Icon = "gold", Children = new MenuDataItem[] { new MenuDataItem @@ -42,21 +42,45 @@ namespace NewWMSProject.Layouts }, new MenuDataItem { - Path = "/TaskInfo", + Path = "/task", Name = "任务管理", Key = "TaskInfo", - Icon = "task", + Icon = "project", Children = new MenuDataItem[] { new MenuDataItem { - Path = "/Welcome", - Name = "欢迎页面", - Key = "welcome" + Path = "/task/task_list", + Name = "任务列表", + Key = "task_list" } } + }, + new MenuDataItem + { + Path = "/input", + Name = "入库操作", + Key = "Input", + Icon = "up-circle", + Children = new MenuDataItem[] + { + new MenuDataItem + { + Path = "/input/plan_in", + Name = "入库订单", + Key = "plan_in" + }, + new MenuDataItem + { + Path = "/input/manage_in_individual", + Name = "无计划入库", + Key = "manage_in_individual" + } + } + + }, new MenuDataItem { diff --git a/NewWMSProject/src/NewWMSProject.Client/Models/ManageListData.cs b/NewWMSProject/src/NewWMSProject.Client/Models/ManageListData.cs new file mode 100644 index 0000000..54b15f5 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Models/ManageListData.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; + +namespace NewWMSProject.Models; + +/// +/// 管理任务子表 +/// +public record ManageListData +{ + [DisplayName("行ID")] public int ROW_ID { get; set; } = 0; + + [DisplayName("物料号")] + [Required] + public string GOODS_CODE { get; set; } + + [DisplayName("数量")] public decimal MANAGE_LIST_QUANTITY { get; set; } = 10; + + [DisplayName("备注")] + public string MANAGE_LIST_REMARK { get; set; } + + [DisplayName("批次号")] + public string BOX_BARCODE { get; set; } + + [DisplayName("位置")] + public string GOODS_PROPERTY1 { get; set; } + + [DisplayName("属性")] + public string GOODS_PROPERTY2 { get; set; } + + + //public string GOODS_PROPERTY3 { get; set; } + + + //public string GOODS_PROPERTY4 { get; set; } + + + //public string GOODS_PROPERTY5 { get; set; } + + + //public string GOODS_PROPERTY6 { get; set; } + + + //public string GOODS_PROPERTY7 { get; set; } + + + //public string GOODS_PROPERTY8 { get; set; } +} \ No newline at end of file diff --git a/NewWMSProject/src/NewWMSProject.Client/Models/ManageMainData.cs b/NewWMSProject/src/NewWMSProject.Client/Models/ManageMainData.cs new file mode 100644 index 0000000..765bf36 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Models/ManageMainData.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; + +namespace NewWMSProject.Models; +/// +/// 管理任务主表 +/// +public record ManageMainData +{ + + public int MANAGE_ID { get; set; } + + public int PLAN_ID { get; set; } + [DisplayName("任务类型")] + public string MANAGE_TYPE_CODE { get; set; } + [DisplayName("任务状态")] + public string MANAGE_STATUS { get; set; } + [Required] + [DisplayName("托盘号")] + public string STOCK_BARCODE { get; set; } + + public int START_CELL_ID { get; set; } + + public int END_CELL_ID { get; set; } + + public string MANAGE_OPERATOR { get; set; } + + public string MANAGE_BEGIN_TIME { get; set; } + + public string MANAGE_END_TIME { get; set; } + + public string MANAGE_LEVEL { get; set; } + + public string MANAGE_REMARK { get; set; } + + public string MANAGE_CONFIRM_TIME { get; set; } +} \ No newline at end of file diff --git a/NewWMSProject/src/NewWMSProject.Client/Models/MaterialData.cs b/NewWMSProject/src/NewWMSProject.Client/Models/MaterialData.cs new file mode 100644 index 0000000..e997527 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Models/MaterialData.cs @@ -0,0 +1,21 @@ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace NewWMSProject.Models; + +public record MaterialData +{ + [DisplayName("物料ID")] + public int GOODS_ID { get; set; } + [Required] + [DisplayName("物料代码")] + public string GOODS_CODE { get; set; } + [DisplayName("物料名称")] + public string GOODS_NAME { get; set; } + [DisplayName("物料单位")] + public string GOODS_UNITS { get; set; } + [DisplayName("属性1")] + public string GOODS_CONST_PROPERTY1 { get; set; } + [DisplayName("属性2")] + public string GOODS_CONST_PROPERTY2 { get; set; } +} \ No newline at end of file diff --git a/NewWMSProject/src/NewWMSProject.Client/Models/V_Manage_Info.cs b/NewWMSProject/src/NewWMSProject.Client/Models/V_Manage_Info.cs new file mode 100644 index 0000000..eff5864 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Models/V_Manage_Info.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; + +namespace NewWMSProject.Models; + +public record V_Manage_Info +{ + [DisplayName("任务ID")] + public int? MANAGE_ID { get; set; } + + [DisplayName("托盘号")] + public string? STOCK_BARCODE { get; set; } + [DisplayName("任务类型")] + public string? MANAGE_TYPE_NAME { get; set; } + [DisplayName("起始位置")] + public string? START_POSITION { get; set; } + [DisplayName("结束位置")] + public string? END_POSITION { get; set; } + [DisplayName("任务状态")] + public string? MANAGE_STATUS { get; set; } + [DisplayName("操作者")] + public string? MANAGE_OPERATOR { get; set; } + [DisplayName("开始时间")] + public string? MANAGE_BEGIN_TIME { get; set; } + [DisplayName("备注信息")] + public string? MANAGE_REMARK { get; set; } + +} \ No newline at end of file diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Material/MainMaterial.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Material/MainMaterial.razor index dbdbaac..9950ff0 100644 --- a/NewWMSProject/src/NewWMSProject.Client/Pages/Material/MainMaterial.razor +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Material/MainMaterial.razor @@ -3,26 +3,30 @@ @using EFCoreDatabase.Entities @page "/material/main_material" @inject IGoodsRepository _GoodsRepository + - +
- - + + @* *@ - - Edit + + 编 辑 @* Delete *@
+
+ + @inject ModalService ModalService; -@inject ConfirmService ComfirmService; +@inject ConfirmService ConfirmService; @code { List mockDb = new(); @@ -46,7 +50,7 @@ { Title = data.GOODS_ID > 0 ? "Edit" : "New", Content = @
- + , OnOk = async (e) => @@ -64,7 +68,15 @@ var index = mockDb.FindIndex(x => x.GOODS_ID == data.GOODS_ID); mockDb[index] = data; //更新物料主数据 - + var goodsMain = new GOODS_MAIN() + { + GOODS_CODE = data.GOODS_CODE, + GOODS_NAME = data.GOODS_NAME, + GOODS_UNITS = data.GOODS_UNITS, + GOODS_CONST_PROPERTY1 = data.GOODS_CONST_PROPERTY1, + GOODS_CONST_PROPERTY2 = data.GOODS_CONST_PROPERTY2 + }; + _GoodsRepository.UpdateGoodsMain(goodsMain); } else { @@ -88,7 +100,7 @@ }, OnCancel = async (e) => { - if (form.IsModified && (!await Comfirm("The form have been updated, are you sure quit?"))) + if (form.IsModified && (!await Confirm("The form have been updated, are you sure quit?"))) { return; } @@ -99,7 +111,7 @@ async Task DeleteAll() { - if (!await Comfirm($"Are you sure delete {_selectedRows.Count()} rows?")) + if (!await Confirm($"Are you sure delete {_selectedRows.Count()} rows?")) return; mockDb = mockDb.Except(_selectedRows).ToList(); @@ -109,7 +121,7 @@ async Task Delete(MaterialData row) { - if (!await Comfirm($"Are you sure delete [{row.GOODS_NAME}]?")) + if (!await Confirm($"Are you sure delete [{row.GOODS_NAME}]?")) return; mockDb = mockDb.Except(new[] { row }).ToList(); @@ -124,19 +136,19 @@ mockDb = Enumerable.Range(0, goodsList.Count).Select(i => new MaterialData { GOODS_ID = goodsList[i].GOODS_ID,GOODS_CODE = goodsList[i].GOODS_CODE,GOODS_NAME =goodsList[i].GOODS_NAME,GOODS_UNITS = goodsList[i].GOODS_UNITS,GOODS_CONST_PROPERTY1 = goodsList[i].GOODS_CONST_PROPERTY1,GOODS_CONST_PROPERTY2 = goodsList[i].GOODS_CONST_PROPERTY2}).ToList(); } - private async Task Comfirm(string message) + private async Task Confirm(string message) { - return await ComfirmService.Show(message, "Confirm", ConfirmButtons.YesNo, ConfirmIcon.Warning) == ConfirmResult.Yes; + return await ConfirmService.Show(message, "Confirm", ConfirmButtons.YesNo, ConfirmIcon.Warning) == ConfirmResult.Yes; } - public record MaterialData - { - public int GOODS_ID { get; set; } - [Required] - public string GOODS_CODE { get; set; } - public string GOODS_NAME { get; set; } - public string GOODS_UNITS { get; set; } - public string GOODS_CONST_PROPERTY1 { get; set; } - public string GOODS_CONST_PROPERTY2 { get; set; } - } + // public record MaterialData + // { + // public int GOODS_ID { get; set; } + // [Required] + // public string GOODS_CODE { get; set; } + // public string GOODS_NAME { get; set; } + // public string GOODS_UNITS { get; set; } + // public string GOODS_CONST_PROPERTY1 { get; set; } + // public string GOODS_CONST_PROPERTY2 { get; set; } + // } } diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/Component/CreatePlanComponent.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/Component/CreatePlanComponent.razor new file mode 100644 index 0000000..96659b5 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/Component/CreatePlanComponent.razor @@ -0,0 +1,117 @@ +@namespace NewWMSProject.Pages.Plan.Component + + +新增表单 +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + +
+
+
+ + + + + + +@code { + private FormModel formModel = new FormModel(); + private List items = new List(); + + private void SubmitForm() + { + // 提交逻辑 + } + + private void CancelForm() + { + // 取消逻辑 + } + + private List _types = new List + { + new Plan_Type(){value = "InBound",name="入库单"}, + new Plan_Type(){value = "OutBound",name="出库单"} + }; + + private record Plan_Type + { + public string value; + public string name; + } + + public class FormModel + { + public string? Plan_id { get; set; } = "AUTOGENERATE"; + + public string? Plan_operator + { + get; + set; + } = "超级用户"; + + public string? Type { get; set; } + public string? Remarks { get; set; } + } + + public class Item + { + public int Id { get; set; } + public string? MaterialNumber { get; set; } + public string? Name { get; set; } + public string? Specification { get; set; } + public int Quantity { get; set; } + public string? Unit { get; set; } + public string? BatchNumber { get; set; } + public string? Waybill { get; set; } + public string? Supplier { get; set; } + public string? Brand { get; set; } + } +} + + diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanIn.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanIn.razor new file mode 100644 index 0000000..dd05bf9 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanIn.razor @@ -0,0 +1,195 @@ +@using System.ComponentModel +@using System.ComponentModel.DataAnnotations +@using AntDesign.TableModels +@using EFCoreDatabase.Entities +@using NewWMSProject.Pages.Plan.Component + +@page "/input/plan_in" +@inject IPlanRepository _PlanRepository + + + + +
+ + + + + + 删 除 + + +
+ + + @* + + + Finished + + *@ + + + + Pause + Stop + + + More + + + + +
+ + + +
+ +@inject ModalService ModalService; +@inject ConfirmService ConfirmService; + +@code { + + RenderFragment menu = + @ + Action 1 + Action 2 + ; + List _data; + + List data; + ITable _table; + private ConfirmRef _confirmRef; + + protected override async Task OnInitializedAsync() + { + await Task.Delay(500); + var planMainList = _PlanRepository.GetPlanMainByInPut(); + + data = Enumerable.Range(0, planMainList.Count).Select(i => new PlanData + { + PLAN_ID = planMainList[i].PLAN_ID, + PLAN_CODE = planMainList[i].PLAN_CODE, + PLAN_TYPE_CODE = planMainList[i].PLAN_TYPE_CODE + }).ToList(); + _data = data; + } + + private async Task OnRowExpand(RowData rowData) + { + if (rowData.Data.PlanList != null) + { + return; + } + else + { + await Task.Delay(1000); + var planListList = _PlanRepository.GetLists(rowData.Data.PLAN_ID); + if (planListList.Count > 0) + { + rowData.Data.PlanList = Enumerable.Range(0, planListList.Count).Select(i => new PlanListData() + { + PLAN_LIST_ID = planListList[i].PLAN_LIST_ID, + PLAN_ID = planListList[i].PLAN_ID, + PLAN_LIST_QUANTITY = planListList[i].PLAN_LIST_QUANTITY + }).ToArray(); + } + else + { + return; + } + + StateHasChanged(); + } + } + + private async Task OpenComponent() + { + + RenderFragment content =@
; + var options = new ConfirmOptions() + { + Title = "Confirm", + Width = 1500, + + Content = content, + OnOk = e => + { + Console.WriteLine("OnOk"); + return Task.CompletedTask; + }, + OnCancel = e => + { + Console.WriteLine("OnCancel"); + return Task.CompletedTask; + } + }; + + _confirmRef = await ModalService.CreateConfirmAsync(options); + + _confirmRef.OnOk = () => + { + Console.WriteLine("ConfirmRef OnOk"); + return Task.CompletedTask; + }; + + _confirmRef.OnOpen = () => + { + Console.WriteLine("ConfirmRef OnOpen"); + return Task.CompletedTask; + }; + + _confirmRef.OnCancel = () => + { + Console.WriteLine("ConfirmRef Confirm"); + return Task.CompletedTask; + }; + + _confirmRef.OnClose = () => + { + Console.WriteLine("ConfirmRef OnClose"); + return Task.CompletedTask; + }; + + } + private async Task CloseModal() + { + if (_confirmRef != null) + { + await _confirmRef.CloseAsync(); + } + } + + private async Task Confirm(string message) + { + return await ConfirmService.Show(message, "Confirm", ConfirmButtons.YesNo, ConfirmIcon.Warning) == ConfirmResult.Yes; + } + + public record PlanData + { + [Required] + [DisplayName("计划ID")] + public int PLAN_ID { get; set; } + + [DisplayName("计划类型")] + public string PLAN_TYPE_CODE { get; set; } + + [DisplayName("计划单号")] + public string PLAN_CODE { get; set; } + + + public PlanListData[] PlanList { get; set; } + } + + public class PlanListData + { + [DisplayName("计划列表ID")] + public int PLAN_LIST_ID { get; set; } + public int PLAN_ID { get; set; } + [DisplayName("计划数量")] + public int? PLAN_LIST_QUANTITY { get; set; } + + } + +} diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanOut.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanOut.razor new file mode 100644 index 0000000..5b6ba22 --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Plan/PlanOut.razor @@ -0,0 +1,5 @@ +

PlanOut

+ +@code { + +} diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Task/ManageIn.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Task/ManageIn.razor new file mode 100644 index 0000000..77d023e --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Task/ManageIn.razor @@ -0,0 +1,353 @@ +@using AntDesign.TableModels +@using System.ComponentModel.DataAnnotations +@using EFCoreDatabase.Entities +@page "/input/manage_in_individual" +@inject IManageRepository _ManageRepository +@inject IGoodsRepository _GoodsRepository +@inject IWhCellRepository _WhCellRepository + + + + + + + + + + + + + + + + + @* 编 辑 *@ + 删 除 + + +
+
+ +@inject ModalService ModalService; +@inject ConfirmService ConfirmService; + +@code { + List mockDb = new(); + IEnumerable _selectedRows = []; + ITable _table; + List _dataSource; + int _total; + ButtonSize _size = ButtonSize.Large; + + void OnChange(QueryModel query) + { + _total = mockDb.AsQueryable().ExecuteTableQuery(query).Count(); + _dataSource = mockDb.AsQueryable().ExecuteTableQuery(query).CurrentPagedRecords(query).ToList(); + } + + + async Task DeleteAll() + { + if (!await Confirm($"你想要删除 {_selectedRows.Count()} 行数据?")) + return; + + mockDb = mockDb.Except(_selectedRows).ToList(); + _selectedRows = []; + _table.ReloadData(); + } + + async Task Delete(ManageListData row) + { + if (!await Confirm($"你要删除第[{row.ROW_ID}]行数据吗?")) + return; + + mockDb = mockDb.Except(new[] { row }).ToList(); + _table.ReloadData(); + } + + protected override void OnInitialized() + { + //加载下拉框列表 + var goodsList = _GoodsRepository.GetGoodsMains(); + if (goodsList.Count > 0) + { + goodInfos = Enumerable.Range(0, goodsList.Count).Select(i => new GoodInfo() + { + Goods_Code = goodsList[i].GOODS_CODE, + Goods_Id = goodsList[i].GOODS_ID.ToString() + }).ToList(); + } + + var warehouseList = _WhCellRepository.GetWarehouses(); + if (warehouseList.Count>0) + { + _list = Enumerable.Range(0, warehouseList.Count).Select(i => new warehouseInfo() + { + WarehouseCode = warehouseList[i].WAREHOUSE_CODE, + warehouseName = warehouseList[i].WAREHOUSE_NAME + }).ToList(); + } + + } + + + + private async Task Confirm(string message) + { + return await ConfirmService.Show(message, "Confirm", ConfirmButtons.YesNo, ConfirmIcon.Warning) == ConfirmResult.Yes; + } + + public class GoodInfo + { + public string Goods_Id { get; set; } + public string Goods_Code { get; set; } + } + + List goodInfos; + string _selectedValue; + GoodInfo _selectedItem; + + + /// + /// 新增库存行,或编辑当前行 + /// + /// + void StartEdit(ManageListData row) + { + var data = row == null ? new() : row with { }; + ModalRef modalRef = default; + IForm form = default; + modalRef = ModalService.CreateModal(new() + { + // + Title = data.ROW_ID> 0 ? "编 辑" : "新 增", + Content = @
+ + +
+ , + OnOk = async (e) => + { + if (!form.Validate()) + { + return; + } + + // save db and refresh + modalRef.SetConfirmLoading(true); + var Temp = data; + if (data.ROW_ID>0) + { + var index = mockDb.FindIndex(x => x.ROW_ID == data.ROW_ID); + mockDb[index] = data; + } + else + { + if (mockDb.Count>0) + { + data.ROW_ID = mockDb.Max(x => x.ROW_ID) + 1; + } + else + { + data.ROW_ID = 1; + } + + data.GOODS_CODE = _selectedItem.Goods_Code; + mockDb.Add(data); + } + + await Task.Delay(1000); + + await modalRef.CloseAsync(); + _table.ReloadData(); + StateHasChanged(); + }, + OnCancel = async (e) => + { + if (form.IsModified && (!await Confirm("表单已经更新,确定要退出吗?"))) + { + return; + } + await modalRef.CloseAsync(); + } + }); + } + + + public RenderFragment? Definitions(string structurePath) + { + var data = new ManageListData(); + + if (structurePath == "GOODS_CODE") + { + return @; + } + return null; + } + + private void OnSelectedItemChangedHandler(GoodInfo value) + { + _selectedItem = value; + Console.WriteLine($"selected: ${value?.Goods_Code}"); + } + + // private void OnBlur() + // { + // Console.WriteLine("blur"); + // } + + // private void OnFocus() + // { + // Console.WriteLine("focus"); + // } + + // private void OnSearch(string value) + // { + // Console.WriteLine($"search: {value}"); + // } + + bool _visible = false; + bool _submitting = false; + private Form _form; + + private Model model = new Model(); + public class Model + { + [Required] + public string stock_barcode { get; set; } + [Required] + public string Password { get; set; } + public bool RememberMe { get; set; } = true; + } + + RenderFragment FormTemplate() + { + return + @
+ + + + + + +
+ ; + } + + private void OnSelectedItemChangedHandlerNew(warehouseInfo value) + { + _selectWarehouseInfo = value; + Console.WriteLine($@"selected warehouse: ${value?.WarehouseCode}"); + } + class warehouseInfo + { + public string warehouseName { get; set; } + public string WarehouseCode { get; set; } + + } + + List _list; + string _selectedWarehouseValue = "1"; + warehouseInfo _selectWarehouseInfo; + + /// + /// when form is submited, close the modal + /// + /// + private void OnFinish(EditContext editContext) + { + _submitting = false; + _visible = false; + } + + private void OnFinishFailed(EditContext editContext) + { + Console.WriteLine($"Failed"); + } + + /// + /// 弹出创建任务表单 + /// + private void ShowModalWithService() + { + ModalRef modalRef = default; + modalRef = ModalService.CreateModal(new() + { + Content = FormTemplate(), + OnOk = async e => + { + modalRef?.SetConfirmLoading(true); + await Task.Delay(1000); + if (!_form.Validate()) + { + modalRef?.SetConfirmLoading(false); + return; + } + + + //获取所有的数据来生成任务 + MANAGE_MAIN manageMain = new MANAGE_MAIN() + { + STOCK_BARCODE = model.stock_barcode, + MANAGE_BEGIN_TIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), + MANAGE_STATUS = "WaitingSend", + START_CELL_ID = 0, + END_CELL_ID = 0, + MANAGE_OPERATOR = "super" + }; + List manageListCollection = new List(); + foreach (var manageListData in mockDb) + { + MANAGE_LIST manageList = new MANAGE_LIST(); + var goodsMain = _GoodsRepository.GetGoodsMain(manageListData.GOODS_CODE); + manageList.GOODS_ID = goodsMain!=null ? goodsMain.GOODS_ID : 0; + manageList.STORAGE_LIST_ID = 0; + manageList.BOX_BARCODE = manageListData.BOX_BARCODE; + manageList.MANAGE_LIST_QUANTITY = manageListData.MANAGE_LIST_QUANTITY; + manageList.MANAGE_LIST_REMARK = manageListData.MANAGE_LIST_REMARK; + manageList.GOODS_PROPERTY1 = manageListData.GOODS_PROPERTY1; + manageList.GOODS_PROPERTY2 = manageListData.GOODS_PROPERTY2; + manageListCollection.Add(manageList); + + } + + _form.Submit(); + + await modalRef.CloseAsync(); + + _form.Reset(); + }, + OnCancel = async e => + { + if (!_form.IsModified || await ModalService.ConfirmAsync(new() { Content = "你想要取消本次入库任务生成么?" })) + { + await modalRef.CloseAsync(); + _form.Reset(); + } + }, + }); + } + +} diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskInfo.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskInfo.razor deleted file mode 100644 index 7ac9055..0000000 --- a/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskInfo.razor +++ /dev/null @@ -1,5 +0,0 @@ -

TaskInfo

- -@code { - -} diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskList.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskList.razor new file mode 100644 index 0000000..049d0ac --- /dev/null +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Task/TaskList.razor @@ -0,0 +1,79 @@ +@using AntDesign.TableModels +@using System.ComponentModel.DataAnnotations +@using EFCoreDatabase.Entities +@inject IManageRepository _ManageRepository +@page "/task/task_list" + + + + + + + + + + + + + + +
+
+ +@using AntDesign.TableModels; +@using System.Text.Json; +@using System; +@using System.Text.Json.Serialization; + +@code { + Table taskList; + List Data; + List currentList; + QueryModel SavedQueryModel; + string SavedQueryModelJson; + + protected override void OnInitialized() + { + var vManageList = _ManageRepository.GetVManages(); + Data = Enumerable.Range(0, vManageList.Count). + Select(i => new V_Manage_Info { MANAGE_ID = vManageList[i].MANAGE_ID, + STOCK_BARCODE = vManageList[i].STOCK_BARCODE, + MANAGE_TYPE_NAME = vManageList[i].MANAGE_TYPE_NAME, + START_POSITION = vManageList[i].START_POSITION, + END_POSITION = vManageList[i].END_POSITION, + MANAGE_STATUS = vManageList[i].MANAGE_STATUS, + MANAGE_OPERATOR = vManageList[i].MANAGE_OPERATOR, + MANAGE_BEGIN_TIME = vManageList[i].MANAGE_BEGIN_TIME, + MANAGE_REMARK = vManageList[i].MANAGE_REMARK == null ? "" : vManageList[i].MANAGE_REMARK + }).ToList(); + } + + void OnChange(QueryModel query) + { + currentList = Data.AsQueryable().ExecuteTableQuery(query).CurrentPagedRecords(query).ToList(); + Console.WriteLine(JsonSerializer.Serialize(query)); + } +} diff --git a/NewWMSProject/src/NewWMSProject.Client/Pages/Welcome.razor b/NewWMSProject/src/NewWMSProject.Client/Pages/Welcome.razor index a952753..9a45e27 100644 --- a/NewWMSProject/src/NewWMSProject.Client/Pages/Welcome.razor +++ b/NewWMSProject/src/NewWMSProject.Client/Pages/Welcome.razor @@ -1,4 +1,5 @@ @page "/Welcome" +@using NewWMSProject.Pages.Plan.Component @@ -38,4 +39,7 @@ .

+

+ +

diff --git a/NewWMSProject/src/NewWMSProject/Program.cs b/NewWMSProject/src/NewWMSProject/Program.cs index c0af60b..793212b 100644 --- a/NewWMSProject/src/NewWMSProject/Program.cs +++ b/NewWMSProject/src/NewWMSProject/Program.cs @@ -37,7 +37,12 @@ builder.Services.Configure(builder.Configuration.GetSection("ProSet builder.Services.AddDbContext(options => options.UseDm("Server=127.0.0.1:5236;UserId=JIAMUSI_WMS_DATABASE;PWD=Siasun4813@;"), ServiceLifetime.Transient); + builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); + var app = builder.Build(); // Configure the HTTP request pipeline. diff --git a/NewWMSWebAPI/Controllers/WeatherForecastController.cs b/NewWMSWebAPI/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..bcc01f0 --- /dev/null +++ b/NewWMSWebAPI/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace NewWMSWebAPI.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/NewWMSWebAPI/NewWMSWebAPI.csproj b/NewWMSWebAPI/NewWMSWebAPI.csproj new file mode 100644 index 0000000..5419ef0 --- /dev/null +++ b/NewWMSWebAPI/NewWMSWebAPI.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/NewWMSWebAPI/NewWMSWebAPI.http b/NewWMSWebAPI/NewWMSWebAPI.http new file mode 100644 index 0000000..2c901b6 --- /dev/null +++ b/NewWMSWebAPI/NewWMSWebAPI.http @@ -0,0 +1,6 @@ +@NewWMSWebAPI_HostAddress = http://localhost:5228 + +GET {{NewWMSWebAPI_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/NewWMSWebAPI/Program.cs b/NewWMSWebAPI/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/NewWMSWebAPI/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/NewWMSWebAPI/Properties/launchSettings.json b/NewWMSWebAPI/Properties/launchSettings.json new file mode 100644 index 0000000..7b53cc0 --- /dev/null +++ b/NewWMSWebAPI/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:19784", + "sslPort": 44360 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5228", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7080;http://localhost:5228", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/NewWMSWebAPI/WeatherForecast.cs b/NewWMSWebAPI/WeatherForecast.cs new file mode 100644 index 0000000..7c48929 --- /dev/null +++ b/NewWMSWebAPI/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace NewWMSWebAPI +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/NewWMSWebAPI/appsettings.Development.json b/NewWMSWebAPI/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/NewWMSWebAPI/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/NewWMSWebAPI/appsettings.json b/NewWMSWebAPI/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/NewWMSWebAPI/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}