37 changed files with 1402 additions and 40 deletions
@ -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; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,69 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace EFCoreDatabase.Entities; |
||||
|
|
||||
|
|
||||
|
[Table("PLAN_MAIN")] |
||||
|
public class PLAN_MAIN |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 自增ID
|
||||
|
/// </summary>
|
||||
|
[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; } |
||||
|
|
||||
|
} |
@ -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; } |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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<PlanRepository> logger) : IPlanRepository |
||||
|
{ |
||||
|
private readonly DmDBContext _context = context; |
||||
|
private readonly ILogger<PlanRepository> _logger = logger; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取planMain的列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="goodsCode"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public List<PLAN_MAIN> 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<PLAN_LIST> GetLists(int planId) |
||||
|
{ |
||||
|
var planListList = _context.Plan_list.Where(x => x.PLAN_ID == planId).ToList(); |
||||
|
return planListList; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
using EFCoreDatabase.Entities; |
||||
|
|
||||
|
namespace EFCoreDatabase.Repositories.Interface; |
||||
|
|
||||
|
public interface IPlanRepository |
||||
|
{ |
||||
|
public List<PLAN_MAIN> GetPlanMainByInPut(); |
||||
|
public List<PLAN_LIST> GetLists(int planId); |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel; |
||||
|
|
||||
|
namespace NewWMSProject.Models; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 管理任务子表
|
||||
|
/// </summary>
|
||||
|
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; }
|
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel; |
||||
|
|
||||
|
namespace NewWMSProject.Models; |
||||
|
/// <summary>
|
||||
|
/// 管理任务主表
|
||||
|
/// </summary>
|
||||
|
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; } |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
@namespace NewWMSProject.Pages.Plan.Component |
||||
|
|
||||
|
|
||||
|
<PageTitle>新增表单</PageTitle> |
||||
|
<div> |
||||
|
<GridRow> |
||||
|
<GridCol Span="12"><Form Model="@formModel" Layout="FormLayout.Horizontal"> |
||||
|
<!-- 单号 --> |
||||
|
<FormItem Label="单号"> |
||||
|
<Input Disabled="true" @bind-value="@formModel.Plan_id"></Input> |
||||
|
</FormItem> |
||||
|
|
||||
|
<!-- 类型 --> |
||||
|
<FormItem Label="类型"> |
||||
|
<Select Mode="SelectMode.Default" |
||||
|
DataSource="@_types" |
||||
|
@bind-Value="@context.Plan_id" |
||||
|
LabelName="@nameof(Plan_Type.name)" |
||||
|
ValueName="@nameof(Plan_Type.value)"> |
||||
|
</Select> |
||||
|
</FormItem> |
||||
|
|
||||
|
<!-- 制单人 --> |
||||
|
<FormItem Label="制单人"> |
||||
|
<Input Disabled="true" @bind-value="@formModel.Plan_operator" /> |
||||
|
</FormItem> |
||||
|
|
||||
|
<!-- 创建时间 --> |
||||
|
<FormItem Label="创建时间"> |
||||
|
<DatePicker Value="@DateTime.Now" Disabled="true" /> |
||||
|
</FormItem> |
||||
|
|
||||
|
<!-- 备注 --> |
||||
|
<FormItem Label="备注"> |
||||
|
<InputTextArea @bind-Value="formModel.Remarks" Rows="3" /> |
||||
|
</FormItem> |
||||
|
</Form> |
||||
|
<!-- 操作按钮 --> |
||||
|
<Button Type="ButtonType.Primary" OnClick="SubmitForm">确 定</Button> |
||||
|
<Button OnClick="CancelForm">取 消</Button> |
||||
|
</GridCol> |
||||
|
<GridCol Span="12"><!-- 商品明细 --> |
||||
|
<Table DataSource="items" TItem="Item" Size="TableSize.Small" > |
||||
|
<PropertyColumn Title="料号" Property="c=>c.MaterialNumber" /> |
||||
|
<PropertyColumn Title="名称" Property="c=>c.Name" /> |
||||
|
<PropertyColumn Title="规格型号" Property="c=>c.Specification" /> |
||||
|
<PropertyColumn Title="数量" Property="c=>c.Quantity" /> |
||||
|
<PropertyColumn Title="计量单位" Property="c=>c.Unit" /> |
||||
|
<PropertyColumn Title="批次号" Property="c=>c.BatchNumber" /> |
||||
|
<PropertyColumn Title="运单号" Property="c=>c.Waybill" /> |
||||
|
<PropertyColumn Title="供应商" Property="c=>c.Supplier" /> |
||||
|
<PropertyColumn Title="品牌" Property="c=>c.Brand" /> |
||||
|
</Table></GridCol> |
||||
|
</GridRow> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
@code { |
||||
|
private FormModel formModel = new FormModel(); |
||||
|
private List<Item> items = new List<Item>(); |
||||
|
|
||||
|
private void SubmitForm() |
||||
|
{ |
||||
|
// 提交逻辑 |
||||
|
} |
||||
|
|
||||
|
private void CancelForm() |
||||
|
{ |
||||
|
// 取消逻辑 |
||||
|
} |
||||
|
|
||||
|
private List<Plan_Type> _types = new List<Plan_Type> |
||||
|
{ |
||||
|
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; } |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
@ -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 |
||||
|
|
||||
|
<PageContainer Title="入库订单"> |
||||
|
|
||||
|
<Button OnClick="OpenComponent" Type="ButtonType.Primary">新 增</Button> |
||||
|
<br /> |
||||
|
<Table DataSource="@_data" TItem="PlanData" OnExpand="OnRowExpand" @ref="_table"> |
||||
|
<ColumnDefinitions> |
||||
|
<PropertyColumn Property="c => c.PLAN_ID"/> |
||||
|
<PropertyColumn Property="c => c.PLAN_CODE"/> |
||||
|
<PropertyColumn Property="c => c.PLAN_TYPE_CODE"/> |
||||
|
<ActionColumn Title="操作按钮"> <a>删 除</a> </ActionColumn> |
||||
|
</ColumnDefinitions> |
||||
|
<ExpandTemplate Context="rowData"> |
||||
|
<Table DataSource="rowData.Data.PlanList" Loading="rowData.Data.PlanList == null" HidePagination> |
||||
|
<PropertyColumn Property="c => c.PLAN_LIST_ID"/> |
||||
|
<PropertyColumn Property="c => c.PLAN_LIST_QUANTITY"/> |
||||
|
@* <Column TData="string" Title="Status"> |
||||
|
<span> |
||||
|
<Badge Status="BadgeStatus.Success" /> |
||||
|
Finished |
||||
|
</span> |
||||
|
</Column> *@ |
||||
|
<PropertyColumn Property="c => c.PLAN_ID"/> |
||||
|
<ActionColumn Title="Action"> |
||||
|
<Space Size="SpaceSize.Middle"> |
||||
|
<SpaceItem><a>Pause</a></SpaceItem> |
||||
|
<SpaceItem><a>Stop</a></SpaceItem> |
||||
|
<SpaceItem> |
||||
|
<Dropdown Overlay="menu"> |
||||
|
<a>More <Icon Type="@IconType.Outline.Down"/></a> |
||||
|
</Dropdown> |
||||
|
</SpaceItem> |
||||
|
</Space> |
||||
|
</ActionColumn> |
||||
|
</Table> |
||||
|
</ExpandTemplate> |
||||
|
</Table> |
||||
|
|
||||
|
</PageContainer> |
||||
|
|
||||
|
@inject ModalService ModalService; |
||||
|
@inject ConfirmService ConfirmService; |
||||
|
|
||||
|
@code { |
||||
|
|
||||
|
RenderFragment menu = |
||||
|
@<Menu> |
||||
|
<MenuItem>Action 1</MenuItem> |
||||
|
<MenuItem>Action 2</MenuItem> |
||||
|
</Menu>; |
||||
|
List<PlanData> _data; |
||||
|
|
||||
|
List<PlanData> 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<PlanData> 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 =@<div> <CreatePlanComponent /></div>; |
||||
|
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<bool> 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; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
<h3>PlanOut</h3> |
||||
|
|
||||
|
@code { |
||||
|
|
||||
|
} |
@ -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 |
||||
|
|
||||
|
|
||||
|
<PageContainer Title="无计划入库"> |
||||
|
<Button Type="ButtonType.Primary" Icon="@IconType.Outline.Download" Size="_size" Shape="ButtonShape.Round" OnClick="ShowModalWithService">任务下达</Button> |
||||
|
|
||||
|
<Table @ref="_table" TItem="ManageListData" DataSource="_dataSource" PageSize="10" Total="_total" @bind-SelectedRows="_selectedRows" OnChange="OnChange" Title="物料信息表汇总"> |
||||
|
<TitleTemplate> |
||||
|
<Flex Justify="FlexJustify.Left" Gap="@("10")"> |
||||
|
<Button Type="ButtonType.Primary" OnClick="() => StartEdit(default)">新增库存行</Button> |
||||
|
<Button Disabled="!_selectedRows.Any()" Danger OnClick="DeleteAll">清除所有行</Button> |
||||
|
</Flex> |
||||
|
</TitleTemplate> |
||||
|
<ColumnDefinitions Context="row"> |
||||
|
<Selection/> |
||||
|
<GenerateColumns Definitions="@((n, c) => { c.Filterable = true; c.Sortable = true; })"/> |
||||
|
<ActionColumn Title="动 作"> |
||||
|
@* <a @onclick="() => StartEdit(row)">编 辑</a> *@ |
||||
|
<a @onclick="() => Delete(row)">删 除</a> |
||||
|
</ActionColumn> |
||||
|
</ColumnDefinitions> |
||||
|
</Table> |
||||
|
</PageContainer> |
||||
|
|
||||
|
@inject ModalService ModalService; |
||||
|
@inject ConfirmService ConfirmService; |
||||
|
|
||||
|
@code { |
||||
|
List<ManageListData> mockDb = new(); |
||||
|
IEnumerable<ManageListData> _selectedRows = []; |
||||
|
ITable _table; |
||||
|
List<ManageListData> _dataSource; |
||||
|
int _total; |
||||
|
ButtonSize _size = ButtonSize.Large; |
||||
|
|
||||
|
void OnChange(QueryModel<ManageListData> 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<bool> 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<GoodInfo> goodInfos; |
||||
|
string _selectedValue; |
||||
|
GoodInfo _selectedItem; |
||||
|
|
||||
|
|
||||
|
/// <summary> |
||||
|
/// 新增库存行,或编辑当前行 |
||||
|
/// </summary> |
||||
|
/// <param name="row"></param> |
||||
|
void StartEdit(ManageListData row) |
||||
|
{ |
||||
|
var data = row == null ? new() : row with { }; |
||||
|
ModalRef<bool> modalRef = default; |
||||
|
IForm form = default; |
||||
|
modalRef = ModalService.CreateModal<bool>(new() |
||||
|
{ |
||||
|
// |
||||
|
Title = data.ROW_ID> 0 ? "编 辑" : "新 增", |
||||
|
Content = @<Form @ref="form" Model="data" OnFinish="() => modalRef.OkAsync(true)" LabelColSpan="6" WrapperColSpan="18"> |
||||
|
|
||||
|
<GenerateFormItem Definitions="Definitions" NotGenerate="@(x=> x == "ROW_ID")"></GenerateFormItem> |
||||
|
</Form> |
||||
|
, |
||||
|
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 @<Select TItem="GoodInfo" name="GOODS_CODE_LIST" |
||||
|
TItemValue="string" |
||||
|
DataSource="@goodInfos" |
||||
|
LabelName="@nameof(GoodInfo.Goods_Code)" |
||||
|
ValueName="@nameof(GoodInfo.Goods_Code)" |
||||
|
Placeholder="选择物料" |
||||
|
DefaultActiveFirstOption="false" |
||||
|
OnSelectedItemChanged="OnSelectedItemChangedHandler" |
||||
|
EnableSearch |
||||
|
FilterExpression="(item, searchValue) => CultureInfo.CurrentCulture.CompareInfo.IndexOf(item.Label, searchValue, CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase) >= 0"> |
||||
|
</Select>; |
||||
|
} |
||||
|
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<Model> _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 |
||||
|
@<Form Model="@model" |
||||
|
LabelColSpan="8" |
||||
|
WrapperColSpan="16" |
||||
|
OnFinish="OnFinish" |
||||
|
OnFinishFailed="OnFinishFailed" |
||||
|
@ref="@_form"> |
||||
|
<FormItem Label="托盘号"> |
||||
|
<Input @bind-Value="@context.stock_barcode" /> |
||||
|
</FormItem> |
||||
|
<FormItem Label="目的库区"> |
||||
|
<Select DataSource="@_list" |
||||
|
@bind-Value="@_selectedWarehouseValue" |
||||
|
ValueName="@nameof(warehouseInfo.WarehouseCode)" |
||||
|
LabelName="@nameof(warehouseInfo.warehouseName)" |
||||
|
Style="width: 120px;" |
||||
|
Placeholder="选择库区" |
||||
|
AllowClear> |
||||
|
</Select> |
||||
|
</FormItem> |
||||
|
</Form> |
||||
|
; |
||||
|
} |
||||
|
|
||||
|
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<warehouseInfo> _list; |
||||
|
string _selectedWarehouseValue = "1"; |
||||
|
warehouseInfo _selectWarehouseInfo; |
||||
|
|
||||
|
/// <summary> |
||||
|
/// when form is submited, close the modal |
||||
|
/// </summary> |
||||
|
/// <param name="args"></param> |
||||
|
private void OnFinish(EditContext editContext) |
||||
|
{ |
||||
|
_submitting = false; |
||||
|
_visible = false; |
||||
|
} |
||||
|
|
||||
|
private void OnFinishFailed(EditContext editContext) |
||||
|
{ |
||||
|
Console.WriteLine($"Failed"); |
||||
|
} |
||||
|
|
||||
|
/// <summary> |
||||
|
/// 弹出创建任务表单 |
||||
|
/// </summary> |
||||
|
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<MANAGE_LIST> manageListCollection = new List<MANAGE_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(); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,5 +0,0 @@ |
|||||
<h3>TaskInfo</h3> |
|
||||
|
|
||||
@code { |
|
||||
|
|
||||
} |
|
@ -0,0 +1,79 @@ |
|||||
|
@using AntDesign.TableModels |
||||
|
@using System.ComponentModel.DataAnnotations |
||||
|
@using EFCoreDatabase.Entities |
||||
|
@inject IManageRepository _ManageRepository |
||||
|
@page "/task/task_list" |
||||
|
<PageContainer> |
||||
|
<Table DataSource="Data" OnChange="OnChange" TItem="V_Manage_Info" @ref="taskList" Size="TableSize.Small"> |
||||
|
<PropertyColumn Property="c=>c.MANAGE_ID" |
||||
|
Sortable |
||||
|
Filterable /> |
||||
|
<PropertyColumn |
||||
|
Property="c=>c.STOCK_BARCODE" |
||||
|
SorterCompare="@((a,b)=> string.Compare(a,b))" |
||||
|
SortDirections="new[] { SortDirection.Descending }" |
||||
|
Filterable /> |
||||
|
|
||||
|
<PropertyColumn |
||||
|
Property="c=>c.MANAGE_BEGIN_TIME" |
||||
|
SorterCompare="@((a,b)=> string.Compare(a,b))" |
||||
|
SortDirections="new[] { SortDirection.Descending, SortDirection.Ascending }" |
||||
|
Filterable /> |
||||
|
|
||||
|
<PropertyColumn |
||||
|
Property="c=>c.MANAGE_OPERATOR" |
||||
|
Format="yyyy/MM/dd" |
||||
|
Sortable |
||||
|
Filterable /> |
||||
|
|
||||
|
<PropertyColumn |
||||
|
Property="c=>c.MANAGE_STATUS" |
||||
|
Sortable |
||||
|
Filterable /> |
||||
|
|
||||
|
<PropertyColumn |
||||
|
Property="c=>c.MANAGE_TYPE_NAME" |
||||
|
Sortable |
||||
|
Filterable /> |
||||
|
|
||||
|
<PropertyColumn |
||||
|
Property="c=>c.MANAGE_REMARK" |
||||
|
Sortable |
||||
|
Filterable /> |
||||
|
</Table> |
||||
|
</PageContainer> |
||||
|
|
||||
|
@using AntDesign.TableModels; |
||||
|
@using System.Text.Json; |
||||
|
@using System; |
||||
|
@using System.Text.Json.Serialization; |
||||
|
|
||||
|
@code { |
||||
|
Table<V_Manage_Info> taskList; |
||||
|
List<V_Manage_Info> Data; |
||||
|
List<V_Manage_Info> 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<V_Manage_Info> query) |
||||
|
{ |
||||
|
currentList = Data.AsQueryable().ExecuteTableQuery(query).CurrentPagedRecords(query).ToList(); |
||||
|
Console.WriteLine(JsonSerializer.Serialize(query)); |
||||
|
} |
||||
|
} |
@ -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<WeatherForecastController> _logger; |
||||
|
|
||||
|
public WeatherForecastController(ILogger<WeatherForecastController> logger) |
||||
|
{ |
||||
|
_logger = logger; |
||||
|
} |
||||
|
|
||||
|
[HttpGet(Name = "GetWeatherForecast")] |
||||
|
public IEnumerable<WeatherForecast> 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(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net8.0</TargetFramework> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<ImplicitUsings>enable</ImplicitUsings> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
@ -0,0 +1,6 @@ |
|||||
|
@NewWMSWebAPI_HostAddress = http://localhost:5228 |
||||
|
|
||||
|
GET {{NewWMSWebAPI_HostAddress}}/weatherforecast/ |
||||
|
Accept: application/json |
||||
|
|
||||
|
### |
@ -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(); |
@ -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" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft.AspNetCore": "Warning" |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft.AspNetCore": "Warning" |
||||
|
} |
||||
|
}, |
||||
|
"AllowedHosts": "*" |
||||
|
} |
Loading…
Reference in new issue