signalr 取消,长时间会有问题,打开浏览器会白屏

对接erp,接口 线边任务完成根据detailid,分入库 出库报工
todo 成品的报工(定时器回传 or 入库/拣货的时候回传)
This commit is contained in:
zhougf committed 2025-12-30 21:20:06 +08:00
1 parent 00119151c9
commit c3ec557c4d
19 files changed
+403 -362

No files matched your search

@@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using WalkingTec.Mvvm.Mvc;
using HHWMS.Web;
using HHWMS.Web.Models;
namespace HHWMS.Web.Controllers
{
[Area("inventory")]
[Public]
[ActionDescription("库存管理")]
[ApiController]
[Route("api/Inventory")]
public partial class InventoryApiController : BaseApiController
{
[ActionDescription("Sys.Search")]
[HttpPost("Search")]
[Public]
public IActionResult Search(InventoryApiSearcher searcher)
{
if (ModelState.IsValid)
{
var vm = Wtm.CreateVM<InventoryApiListVM>(passInit: true);
searcher.SortInfo = new SortInfo()
{
Property = "MaterialCode",
Direction = SortDir.Asc
};
searcher.IsPlainText = false;
searcher.IsEnumToString = true;
vm.Searcher = searcher;
if (searcher.WareHouse.ToLower() == "mj")
vm.Searcher.ZoneId = 1025;
else if (searcher.WareHouse.ToLower() == "xb")
vm.Searcher.ZoneId = 1027;
else if (searcher.WareHouse.ToLower() == "cp")
vm.Searcher.ZoneId = 1028;
var data = vm.GetJson();
return Content(data);
}
else
{
return BadRequest(ModelState.GetErrorJson());
}
}
}
}
@@ -549,6 +549,10 @@ namespace HHWMS.Web.Controllers
{
return FFResult().Alert("所选库存没关联订单,无需回传!").RefreshGrid();
}
if (inv.UploadErpFlag == 0)
{
return FFResult().Alert("所选库存已报工回传,无需再次回传!").RefreshGrid();
}
// 构建ERP请求
// 字段映射参照 ReceiptInController:
@@ -562,8 +566,8 @@ namespace HHWMS.Web.Controllers
{
Main = new FinishInMain
{
ErpCode = "999", // 账套号
InCode = $"{inv.SourceCode}-{DateTime.Now.Ticks}", // 报工单号(上游单号)
ErpCode = "002", // 账套号
InCode = _unitWork.GetSerialNumber("RW"), // 报工单号(上游单号)
InDate = (inv.CreateTime ?? DateTime.Now).ToString("yyyy-MM-dd"), // 报工日期
StepCode = inv.BatchCode, // 工序(批次编码)
WorkerCode = inv.CreateBy, // 工人编码(创建人)
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using HHWMS.Web.Models;
namespace HHWMS.Web
{
public partial class InventoryApiListVM : BasePagedListVM<InventoryApi_View, InventoryApiSearcher>
{
protected override IEnumerable<IGridColumn<InventoryApi_View>> InitGridHeader()
{
return new List<GridColumn<InventoryApi_View>>{
this.MakeGridHeader(x => x.WareHouse),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.FigureNo),
this.MakeGridHeader(x => x.MaterialName),
this.MakeGridHeader(x => x.MaterialSpec),
this.MakeGridHeader(x => x.BatchCode),
this.MakeGridHeader(x => x.SuFigureNo),
this.MakeGridHeader(x => x.Qty),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<InventoryApi_View> GetSearchQuery()
{
var query = DC.Set<Inventory>()
.Where(x => x.ZoneId == Searcher.ZoneId)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.FigureNo, x=>x.MaterialType)
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
.CheckContain(Searcher.MaterialSpec, x=>x.MaterialSpec)
.CheckContain(Searcher.BatchCode, x=>x.BatchCode)
.CheckContain(Searcher.SuFigureNo, x=>x.SupplierCode)
.Select(x => new InventoryApi_View
{
WareHouse = x.ZoneId == 1027 ? "xb" : x.ZoneId == 1028 ? "cp" : "mj" ,
MaterialCode = x.MaterialCode,
FigureNo = x.MaterialType,
MaterialName = x.MaterialName,
MaterialSpec = x.MaterialSpec,
BatchCode = x.BatchCode,
SuFigureNo = x.SupplierCode,
LocationCode = x.LocationCode,
Qty = x.Qty,
}).OrderBy(x => x.MaterialCode);
return query;
}
}
public class InventoryApi_View : TopBasePoco {
public String WareHouse { get; set; }
public string MaterialCode { get; set; }
public string MaterialName { get; set; }
public string MaterialSpec { get; set; }
public string BatchCode { get; set; }
public string SuFigureNo { get; set; }
public string FigureNo { get; set; }
public string LocationCode { get; set; }
public decimal? Qty { get; set; }
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web.Models;
namespace HHWMS.Web
{
public partial class InventoryApiSearcher : BaseSearcher
{
public int ZoneId { get; set; }
[Display(Name = "Inventory.MaterialCode")]
public String MaterialCode { get; set; }
[Display(Name = "Inventory.MaterialType")]
public String FigureNo { get; set; }
[Display(Name = "Inventory.MaterialName")]
public String MaterialName { get; set; }
[Display(Name = "Inventory.MaterialSpec")]
public String MaterialSpec { get; set; }
[Display(Name = "Inventory.Batch")]
public String BatchCode { get; set; }
[Display(Name = "Inventory.SupplierCode")]
public String SuFigureNo { get; set; }
public String WareHouse { get; set; }
protected override void InitVM()
{
}
}
}
@@ -39,6 +39,10 @@ namespace HHWMS.Web
public String Status { get; set; }
[Display(Name = "Inventory.TaskStatus")]
public InventoryTaskStatusEnum? TaskStatus { get; set; }
public string SupplierCode { get; set; }
public string BatchCode { get; set; }
public string MaterialSpec { get; set; }
protected override void InitVM()
{