修改
This commit is contained in:
parent
c494b7b1ef
commit
523dee5e38
@ -113,6 +113,7 @@ namespace HHWMS.Web
|
||||
_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
tasktolocatioin.Status = LocationStatus.有货;
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode),
|
||||
@ -180,7 +181,7 @@ namespace HHWMS.Web
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if (plrTask != null)
|
||||
{
|
||||
var details = plrTask.TaskDetails.Where(x => x.ContainerCode.Equals(task.ContainerCode));
|
||||
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Equals(task.ContainerCode));
|
||||
foreach (var detail in details)
|
||||
{
|
||||
detail.Status = TaskStatusEnum.待下发;
|
||||
@ -193,7 +194,7 @@ namespace HHWMS.Web
|
||||
else if (task.Station == "2")
|
||||
{
|
||||
// 下发盘料入库
|
||||
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料入库)
|
||||
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料入库) && !string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if (plrTask != null)
|
||||
@ -204,7 +205,7 @@ namespace HHWMS.Web
|
||||
&& x.Type.Equals(LocationTypeEnum.机械臂工位))?.Code;
|
||||
plrTask.ToLocation = to;
|
||||
// 更新明细为待下发
|
||||
var details = plrTask.TaskDetails.Where(x => x.ContainerCode.Equals(task.ContainerCode));
|
||||
var details = plrTask.TaskDetails.Where(x =>!string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Contains(task.ContainerCode));
|
||||
|
||||
foreach(var item in details)
|
||||
{
|
||||
@ -224,15 +225,15 @@ namespace HHWMS.Web
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (invIn != null)
|
||||
{
|
||||
invIn.ContainerCode = task.ContainerCode;
|
||||
invIn.LocationCode = task.ContainerCode;
|
||||
invIn.ContainerCode = taskdetail.ContainerCode;
|
||||
invIn.LocationCode = taskdetail.ContainerCode;
|
||||
invIn.Lot = taskdetail.ToLocation;
|
||||
_unitwork.Update(invIn);
|
||||
}
|
||||
task.TaskDetails.First(x => x.FromLocation == ll).Status = TaskStatusEnum.完成;
|
||||
var containerCode = task.TaskDetails.First(x => x.FromLocation == ll).ContainerCode;
|
||||
// 查询料塔 是否还有 此料盒 已下发,未完成的盘料入库任务 有不操作,没有 创建料盒入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成 && x.ContainerCode.Equals(containerCode)))
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成 && !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Equals(containerCode)))
|
||||
{
|
||||
var station = _unitwork.Find<Location>(x => x.Code == task.FromLocation).FirstOrDefault();
|
||||
// 创建料盒入库任务
|
||||
|
||||
@ -2,6 +2,8 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.SqlServer.Query.Internal;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
@ -39,7 +41,13 @@ namespace HHWMS.Web
|
||||
Inventorys.CopyContext(this);
|
||||
Inventorys.Searcher.LocationCode = Entity.Code;
|
||||
|
||||
_unitWork = new UnitWork(Wtm);
|
||||
//var tt = DC.Set<TaskHeader>().Where(x => x.ID > 1).Include(x => x.TaskDetails);
|
||||
//_unitWork = new UnitWork(Wtm);
|
||||
//var task = _unitWork.Find<TaskHeader>(x => x.ID > 1)
|
||||
// .Include(x => x.TaskDetails)
|
||||
// .FirstOrDefault();
|
||||
//var details = task.TaskDetails;
|
||||
|
||||
var CurrentCulture = Wtm.CurrentCulture;
|
||||
var dictDatas = DC.Set<SysDictData>().ToList();
|
||||
RoadwayTypes = dictDatas.Where(x => x.DictType == "RoadwayType").Select(x => new ComboSelectListItem
|
||||
|
||||
@ -135,22 +135,30 @@ namespace HHWMS.Web.Controllers
|
||||
var detailList = new List<ReceiptDetail>();
|
||||
foreach(var item in plList)
|
||||
{
|
||||
detailList.Add(new ReceiptDetail
|
||||
if (!string.IsNullOrEmpty(item))
|
||||
{
|
||||
UniqueCode = item,
|
||||
MaterialType = "PL",
|
||||
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||
});
|
||||
detailList.Add(new ReceiptDetail
|
||||
{
|
||||
UniqueCode = item,
|
||||
Status = 0,
|
||||
MaterialType = "PL",
|
||||
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in slList)
|
||||
{
|
||||
detailList.Add(new ReceiptDetail
|
||||
if (!string.IsNullOrEmpty(item))
|
||||
{
|
||||
UniqueCode = item,
|
||||
MaterialType = "SL",
|
||||
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||
});
|
||||
detailList.Add(new ReceiptDetail
|
||||
{
|
||||
UniqueCode = item,
|
||||
MaterialType = "SL",
|
||||
Status = 0,
|
||||
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||
});
|
||||
}
|
||||
}
|
||||
_unitwork.BatchAdd(detailList.ToArray());
|
||||
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||
|
||||
@ -36,7 +36,8 @@ public class ReceiptSLInController : BaseController
|
||||
// 查询站台占用
|
||||
var stations = _unitWork.Find<Location>(x => (x.Code == StationCode.散料库左抽屉
|
||||
|| x.Code == StationCode.散料库右抽屉)
|
||||
&& x.Status != LocationStatus.任务锁).ToList();
|
||||
&& x.Status == LocationStatus.空仓位
|
||||
).ToList();
|
||||
if (stations.Count == 0) return JsonMore(null, 500, "无可用站台!");
|
||||
|
||||
// 查找没任务的仓位,分两边查,那边站台能用 查哪边
|
||||
|
||||
@ -14,7 +14,7 @@ namespace HHWMS.Web
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeAction("ReceiptDetail","Create2",Localizer["Sys.Create"],Localizer["Sys.Create"],GridActionParameterTypesEnum.NoId,"receipt").SetOnClickScript("CreateDetail"),
|
||||
this.MakeAction("ReceiptDetail","CreateDetail",Localizer["Sys.CreateDetails"],Localizer["Sys.CreateDetails"],GridActionParameterTypesEnum.NoId,"receipt").SetOnClickScript("CreateDetails"),
|
||||
this.MakeAction("ReceiptDetail","CreateDetails",Localizer["Sys.CreateDetails"],Localizer["Sys.CreateDetails"],GridActionParameterTypesEnum.NoId,"receipt").SetOnClickScript("CreateDetails"),
|
||||
|
||||
this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "receipt", dialogWidth: 800),
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
@* <wt:textbox field="Entity.CompanyCode" />
|
||||
<wt:textbox field="Entity.SupplierCode" />
|
||||
<wt:textbox field="Entity.TotalQty" />
|
||||
<wt:textbox field="Entity.TotalLines" />
|
||||
<wt:combobox field="Entity.LastStatus" />
|
||||
<wt:textbox field="Entity.TotalLines" />*@
|
||||
<wt:combobox field="Entity.FirstStatus" />
|
||||
<wt:combobox field="Entity.LastStatus" /> *@
|
||||
<wt:datetime field="Entity.AppointmentTime" type="DateTime" />
|
||||
<wt:textbox field="Entity.Remark" />
|
||||
</wt:row>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
@model HHWMS.Web.ReceiptHeaderListVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="header">
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="ReceiptHeader">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
@* <wt:textbox field="Searcher.SourceCode" /> *@
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
@ -10,14 +10,14 @@
|
||||
@* <wt:combobox field="Searcher.LastStatus" empty-text="@Localizer["Sys.All"]" /> *@
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" id="header" url="/receipt/ReceiptHeader/Search" limit="7" />
|
||||
<wt:grid vm="@Model.ReceiptDetails" id="detail" url="/receipt/ReceiptDetail/Search2" height="400" />
|
||||
<wt:grid vm="@Model" id="ReceiptHeader" url="/receipt/ReceiptHeader/Search" limit="7" />
|
||||
<wt:grid vm="@Model.ReceiptDetails" id="ReceiptDetail" url="/receipt/ReceiptDetail/Search2" height="400" />
|
||||
|
||||
<script>
|
||||
var headerId = 0;
|
||||
function details(id) {
|
||||
headerId = id;
|
||||
layui.table.reload('detail', { where: { "Searcher.ReceiptHeaderId": id } });
|
||||
layui.table.reload('ReceiptDetail', { where: { "Searcher.ReceiptHeaderId": id } });
|
||||
}
|
||||
|
||||
function CreateDetail() {
|
||||
|
||||
@ -197,17 +197,17 @@
|
||||
}
|
||||
},
|
||||
// 扫描周转箱
|
||||
scanBox(data) {
|
||||
scanBox(Box) {
|
||||
var _this = this;
|
||||
_this.form.size = '';
|
||||
_this.form.boxSize = [];
|
||||
if (data == "L02") {
|
||||
_this.form.boxSize = [{ label: "8mm", value: "8" }]
|
||||
_this.form.size = _this.form.boxSize[0].value;
|
||||
if (Box == "L02") {
|
||||
_this.form.boxSize = [{ label: "24mm", value: "24" }, { label: "16mm", value: "16" }, { label: "10mm", value: "10" }]
|
||||
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
|
||||
}
|
||||
else if (data == "L01") {
|
||||
_this.form.boxSize = [{ label: "10mm", value: "10" }, { label: "16mm", value: "16" }, { label: "24mm", value: "24" }];
|
||||
else if (Box == "L01") {
|
||||
_this.form.boxSize = [{ label: "8mm", value: "8" }];
|
||||
_this.form.size = _this.form.boxSize[0].value;
|
||||
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
|
||||
}
|
||||
else {
|
||||
@ -217,12 +217,14 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(Box);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { boxCode: data },
|
||||
data: { boxCode: Box },
|
||||
url: "/receipt/ReceiptIn/ScanBox",
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "扫描失败!" + json.Msg,
|
||||
|
||||
@ -38,13 +38,25 @@ public class ShipOutController : BaseController
|
||||
[HttpPost]
|
||||
public ActionResult ScanBox(string code)
|
||||
{
|
||||
Location box = new Location();
|
||||
if (code.Contains("C"))
|
||||
{
|
||||
box = _unitWork.FindSingle<Location>(x => x.ContainerCode.Equals(code) && x.Type == LocationTypeEnum.散料库站台);
|
||||
}
|
||||
else if (code.Contains("L"))
|
||||
{
|
||||
box = _unitWork.FindSingle<Location>(x => x.Code.Equals(code));
|
||||
}
|
||||
// 判断箱号是否合理
|
||||
var box = _unitWork.FindSingle<Location>(x => x.Code.Equals(code));
|
||||
if (box != null)
|
||||
{
|
||||
if (box.Type == LocationTypeEnum.散料库站台 || box.Type == LocationTypeEnum.料塔)
|
||||
{
|
||||
var inv = _unitWork.Find<Inventory>(x => x.LocationCode.Equals(code));
|
||||
if (code.Contains("C"))
|
||||
{
|
||||
inv = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(code));
|
||||
}
|
||||
return JsonMore(inv);
|
||||
}
|
||||
else
|
||||
|
||||
@ -24,7 +24,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
|
||||
var tasks = _unitwork.Find<TaskHeader>(x =>x.Status > TaskStatusEnum.新建 && x.Status <= TaskStatusEnum.已下发)
|
||||
var tasks = _unitwork.Find<TaskHeader>(x =>x.Status > TaskStatusEnum.新建 && x.Status < TaskStatusEnum.已下发)
|
||||
.Include(x => x.TaskDetails)
|
||||
.ToList();
|
||||
foreach (var task in tasks)
|
||||
@ -32,19 +32,33 @@ namespace HHWMS.Web
|
||||
if (task != null)
|
||||
{
|
||||
var count = 0;
|
||||
var Count = 0;
|
||||
if (task.TaskType == TaskTypeEnum.盘料入库)
|
||||
{
|
||||
GenTask(task, _unitwork);
|
||||
//子任务为新建的盘料入库任务不需要下发给WCS
|
||||
count = task.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建).Count();
|
||||
//子任务部分完成,需要下发部分子任务
|
||||
Count = task.TaskDetails.Where(x => x.Status == TaskStatusEnum.待下发).Count();
|
||||
}
|
||||
if (task.TaskType == TaskTypeEnum.盘料出库)
|
||||
else if (task.TaskType == TaskTypeEnum.盘料出库)
|
||||
{
|
||||
OutGenTask(task, _unitwork);
|
||||
//子任务为新建的盘料入库任务不需要下发给WCS
|
||||
count = task.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建).Count();
|
||||
}
|
||||
if (count == 0)
|
||||
else if (task.TaskType == TaskTypeEnum.散料盒出库)
|
||||
{
|
||||
//判断出库站台是否被占用
|
||||
Location endStation = _unitwork.Find<Location>(x => x.Code == task.ToLocation
|
||||
&& x.Status == LocationStatus.空仓位
|
||||
&& string.IsNullOrEmpty(x.ContainerCode)).FirstOrDefault();
|
||||
if (endStation == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (count == 0 || Count > 0)
|
||||
{
|
||||
var taskList = CreateWCSTask(task, _unitwork);
|
||||
foreach (var item in taskList)
|
||||
@ -53,10 +67,10 @@ namespace HHWMS.Web
|
||||
// 调用wcs任务下发接口
|
||||
try
|
||||
{
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, item).Result.Data;
|
||||
//if (true)
|
||||
if (res.Success)
|
||||
{
|
||||
//var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, item).Result.Data;
|
||||
if (true)
|
||||
//if (res.Success)
|
||||
{
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code) || task.ToLocation.Equals(x.Code)).ToList();
|
||||
var begin = locationList.FirstOrDefault(x => x.Code.Equals(task.FromLocation));
|
||||
var end = locationList.FirstOrDefault(x => x.Code.Equals(task.ToLocation));
|
||||
@ -140,15 +154,52 @@ namespace HHWMS.Web
|
||||
var details = task.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建
|
||||
&& string.IsNullOrEmpty(x.ContainerCode));
|
||||
var count = details.Count();
|
||||
// 查找可用站台
|
||||
//根据任务库存查询可对应的出库托盘与巷道
|
||||
var Length = 23;
|
||||
Inventory inventory = _unitwork.Find<Inventory>(x => x.ContainerCode == task.FromLocation).FirstOrDefault();
|
||||
if (inventory != null)
|
||||
{
|
||||
switch (inventory.Flag)
|
||||
{
|
||||
case 8:
|
||||
Length = 23;
|
||||
break;
|
||||
case 10:
|
||||
Length = 19;
|
||||
break;
|
||||
case 16:
|
||||
Length = 16;
|
||||
break;
|
||||
case 24:
|
||||
Length = 13;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var station = _unitwork.FindSingle<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁);
|
||||
if (task.FromLocation == "L01")
|
||||
{
|
||||
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁).OrderByDescending(x => x.Row).FirstOrDefault();
|
||||
}
|
||||
if (station != null && count > 0)
|
||||
{
|
||||
var container = _unitwork.Find<Location>(x => x.Row == station.Row && x.ZoneCode == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器))
|
||||
.OrderByDescending(x => x.Length).FirstOrDefault();
|
||||
if(container != null)
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop)
|
||||
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault();
|
||||
if (Length == 23 && container == null && station.Row == 3)
|
||||
{
|
||||
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁 && x.Row == 1).FirstOrDefault();
|
||||
|
||||
container = _unitwork.Find<Location>(x => x.Row == station.Row && x.ZoneCode == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop)
|
||||
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault();
|
||||
}
|
||||
if(station != null && container != null)
|
||||
{
|
||||
var newTask = new TaskHeader();
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
@ -161,7 +212,7 @@ namespace HHWMS.Web
|
||||
newTask.Station = "2";
|
||||
_unitwork.Add(newTask);
|
||||
|
||||
task.ContainerCode = container.ContainerCode;
|
||||
task.ContainerCode += container.ContainerCode;
|
||||
// 更新库位
|
||||
container.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(container);
|
||||
@ -185,6 +236,13 @@ namespace HHWMS.Web
|
||||
break;
|
||||
}
|
||||
_unitwork.Update(task);
|
||||
station.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(station);
|
||||
}
|
||||
else
|
||||
{
|
||||
task.ErrorMsg = "库内没有符合条件的盘料箱";
|
||||
_unitwork.Update(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using HHWMS.Web.Models;
|
||||
using Humanizer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using Quartz;
|
||||
@ -28,7 +29,7 @@ namespace HHWMS.Web
|
||||
var Shipments = _unitwork.Find<ShipmentHeader>(x =>x.FirstStatus == ShipStatusEnum.分配中)
|
||||
.Include(x => x.ShipmentDetails)
|
||||
.ToList();
|
||||
var shipments = Shipments.Take(5).ToList();
|
||||
var shipments = Shipments.Take(1).ToList();
|
||||
|
||||
foreach (var shipment in shipments)
|
||||
{
|
||||
@ -37,7 +38,6 @@ namespace HHWMS.Web
|
||||
foreach (var ShipmentDetail in ShipmentDetails)
|
||||
{
|
||||
var inventory = _unitwork.Find<Inventory>(x => x.UniqueCode == ShipmentDetail.UniqueCode
|
||||
&& x.ZoneCode == ZoneCodeEnum.盘料库
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务).FirstOrDefault();
|
||||
if (inventory == null)
|
||||
{
|
||||
@ -50,86 +50,172 @@ namespace HHWMS.Web
|
||||
}
|
||||
//出库库存通过托盘号分组
|
||||
var Inventorys = ShiInventorys.GroupBy(x => x.ContainerCode).ToList();
|
||||
foreach (var item in Inventorys)
|
||||
//散料库
|
||||
if (Inventorys.First().Key.Contains("C"))
|
||||
{
|
||||
var task = new TaskHeader();
|
||||
task.TaskDetails = new List<TaskDetail>();
|
||||
var Inventory = item.FirstOrDefault();
|
||||
var location = _unitwork.Find<Location>(x => x.ContainerCode == Inventory.ContainerCode
|
||||
&& x.Status != LocationStatus.空仓位
|
||||
&& x.Status != LocationStatus.空容器).FirstOrDefault();
|
||||
//查询仓位表是否符合
|
||||
if (location != null)
|
||||
foreach (var item in Inventorys)
|
||||
{
|
||||
//查找料塔工位
|
||||
var to = _unitwork.Find<Location>(x => string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.Row == (Inventory.Flag == 8 ? 1 : 3)
|
||||
&& x.Type.Equals(LocationTypeEnum.料塔)).FirstOrDefault();
|
||||
//查询料塔是否为空
|
||||
if (to == null)
|
||||
var inventory = item.FirstOrDefault();
|
||||
//出库托盘
|
||||
Location location = _unitwork.Find<Location>(x => x.Code == inventory.ContainerCode && x.Status != LocationStatus.任务锁).FirstOrDefault();
|
||||
if (location == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||
task.TaskType = TaskTypeEnum.盘料出库;
|
||||
task.Status = TaskStatusEnum.待下发;
|
||||
task.ContainerCode = Inventory.ContainerCode;
|
||||
task.ToLocation = to.Code;
|
||||
task.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
foreach (var inventory in item)
|
||||
// 查询目的地站台是否可用
|
||||
var stations = _unitwork.Find<Location>(x => x.Row == location.Row && x.Type == LocationTypeEnum.散料库站台 && string.IsNullOrEmpty(x.ContainerCode)).FirstOrDefault();
|
||||
if (stations == null)
|
||||
{
|
||||
var detail = new TaskDetail
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//判断是否已经有目的站台的出库任务
|
||||
TaskHeader taskHeader = _unitwork.Find<TaskHeader>(x => x.ToLocation == stations.Code && x.TaskType == TaskTypeEnum.散料盒出库).FirstOrDefault();
|
||||
if (taskHeader != null)
|
||||
{
|
||||
UniqueCode = inventory.UniqueCode,
|
||||
FromLocation = inventory.Lot,
|
||||
Status = TaskStatusEnum.新建,
|
||||
continue;
|
||||
}
|
||||
// 创建任务
|
||||
var task = new TaskHeader
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.散料库,
|
||||
TaskNo = _unitwork.GetSerialNumber("SOut"),
|
||||
TaskType = TaskTypeEnum.散料盒出库,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CreateTime = DateTime.Now
|
||||
FromLocation = location.ContainerCode,
|
||||
ToLocation = stations.Code,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateTime = DateTime.Now,
|
||||
};
|
||||
task.TaskDetails.Add(detail);
|
||||
}
|
||||
_unitwork.Add(task);
|
||||
//更新库位状态
|
||||
var container = _unitwork.Find<Location>(x => x.ContainerCode == Inventory.ContainerCode).FirstOrDefault();
|
||||
if (container != null)
|
||||
{
|
||||
container.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(container);
|
||||
}
|
||||
|
||||
to.ContainerCode = to.Code;
|
||||
_unitwork.Update(to);
|
||||
//更新库存状态
|
||||
var invs = _unitwork.Find<Inventory>(x => x.ContainerCode == Inventory.ContainerCode).ToList();
|
||||
if (invs.Count() > 0)
|
||||
{
|
||||
foreach (var inv in invs)
|
||||
_unitwork.Add(task);
|
||||
//更新库位状态
|
||||
location.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(location);
|
||||
|
||||
//更新库存状态
|
||||
var invs = _unitwork.Find<Inventory>(x => x.ContainerCode == inventory.ContainerCode).ToList();
|
||||
if (invs.Count() > 0)
|
||||
{
|
||||
inv.TaskStatus = InventoryTaskStatus.任务中;
|
||||
_unitwork.Update(inv);
|
||||
foreach (var inv in invs)
|
||||
{
|
||||
inv.TaskStatus = InventoryTaskStatus.任务中;
|
||||
_unitwork.Update(inv);
|
||||
}
|
||||
}
|
||||
//更新单据主表状态
|
||||
foreach (var Inventory in item)
|
||||
{
|
||||
var shipmentdetail = shipment.ShipmentDetails.Where(x => x.ID == int.Parse(Inventory.SourceCode)).FirstOrDefault();
|
||||
if (shipmentdetail != null)
|
||||
{
|
||||
shipmentdetail.Status = ShipStatusEnum.分配完成;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shipment.ShipmentDetails.Any(x => x.Status < ShipStatusEnum.分配完成))
|
||||
{
|
||||
shipment.FirstStatus = ShipStatusEnum.分配完成;
|
||||
_unitwork.Update(shipment);
|
||||
}
|
||||
}
|
||||
//更新单据主表状态
|
||||
foreach (var inventory in item)
|
||||
{
|
||||
var shipmentdetail = shipment.ShipmentDetails.Where(x => x.ID == int.Parse(inventory.SourceCode)).FirstOrDefault();
|
||||
if (shipmentdetail != null)
|
||||
{
|
||||
shipmentdetail.Status = ShipStatusEnum.分配完成;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shipment.ShipmentDetails.Any(x => x.Status < ShipStatusEnum.分配完成))
|
||||
{
|
||||
shipment.FirstStatus = ShipStatusEnum.分配完成;
|
||||
_unitwork.Update(shipment);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//盘料库
|
||||
else if(Inventorys.First().Key.Contains("L"))
|
||||
{
|
||||
foreach (var item in Inventorys)
|
||||
{
|
||||
var task = new TaskHeader();
|
||||
task.TaskDetails = new List<TaskDetail>();
|
||||
var Inventory = item.FirstOrDefault();
|
||||
var location = _unitwork.Find<Location>(x => x.ContainerCode == Inventory.ContainerCode
|
||||
&& x.Status != LocationStatus.空仓位
|
||||
&& x.Status != LocationStatus.空容器).FirstOrDefault();
|
||||
//查询仓位表是否符合
|
||||
if (location != null)
|
||||
{
|
||||
var row = 1;
|
||||
if (Inventory.Flag == 8)
|
||||
{
|
||||
row = 3;
|
||||
}
|
||||
else if(Inventory.Flag == 24 || Inventory.Flag == 16 || Inventory.Flag == 10)
|
||||
{
|
||||
row = 1;
|
||||
}
|
||||
//查找料塔工位
|
||||
var to = _unitwork.Find<Location>(x => string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.Row == row
|
||||
&& x.Type.Equals(LocationTypeEnum.料塔)).FirstOrDefault();
|
||||
|
||||
//查询料塔是否为空
|
||||
if (to == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||
task.TaskType = TaskTypeEnum.盘料出库;
|
||||
task.Status = TaskStatusEnum.待下发;
|
||||
task.ContainerCode = Inventory.ContainerCode;
|
||||
task.ToLocation = to.Code;
|
||||
task.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
foreach (var inventory in item)
|
||||
{
|
||||
var detail = new TaskDetail
|
||||
{
|
||||
UniqueCode = inventory.UniqueCode,
|
||||
FromLocation = inventory.Lot,
|
||||
Status = TaskStatusEnum.新建,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
task.TaskDetails.Add(detail);
|
||||
}
|
||||
_unitwork.Add(task);
|
||||
//更新库位状态
|
||||
var container = _unitwork.Find<Location>(x => x.ContainerCode == Inventory.ContainerCode).FirstOrDefault();
|
||||
if (container != null)
|
||||
{
|
||||
container.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(container);
|
||||
}
|
||||
|
||||
to.ContainerCode = to.Code;
|
||||
_unitwork.Update(to);
|
||||
//更新库存状态
|
||||
var invs = _unitwork.Find<Inventory>(x => x.ContainerCode == Inventory.ContainerCode).ToList();
|
||||
if (invs.Count() > 0)
|
||||
{
|
||||
foreach (var inv in invs)
|
||||
{
|
||||
inv.TaskStatus = InventoryTaskStatus.任务中;
|
||||
_unitwork.Update(inv);
|
||||
}
|
||||
}
|
||||
//更新单据主表状态
|
||||
foreach (var inventory in item)
|
||||
{
|
||||
var shipmentdetail = shipment.ShipmentDetails.Where(x => x.ID == int.Parse(inventory.SourceCode)).FirstOrDefault();
|
||||
if (shipmentdetail != null)
|
||||
{
|
||||
shipmentdetail.Status = ShipStatusEnum.分配完成;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shipment.ShipmentDetails.Any(x => x.Status < ShipStatusEnum.分配完成))
|
||||
{
|
||||
shipment.FirstStatus = ShipStatusEnum.分配完成;
|
||||
_unitwork.Update(shipment);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
@model HHWMS.Web.SysDictTypeListVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="header">
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="SysDictType">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:textbox field="Searcher.DictName" />
|
||||
<wt:textbox field="Searcher.DictType" />
|
||||
<wt:textbox field="Searcher.Remark" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" id="header" url="/system/SysDictType/Search"/>
|
||||
<wt:grid vm="@Model.SysDictDatas" id="detail" url="/system/SysDictData/Search2" limit="8" height="300" />
|
||||
<wt:grid vm="@Model" id="SysDictType" url="/system/SysDictType/Search" />
|
||||
<wt:grid vm="@Model.SysDictDatas" id="SysDictData" url="/system/SysDictData/Search2" limit="8" height="300" />
|
||||
|
||||
<script>
|
||||
var headerId = 0;
|
||||
var DictType = "";
|
||||
function details(id) {
|
||||
headerId = id;
|
||||
var loaddata = layui.table.cache['header'];
|
||||
var loaddata = layui.table.cache['SysDictType'];
|
||||
loaddata.forEach(function (val, i) {
|
||||
if (val.ID == id) {
|
||||
DictType = val.DictType;
|
||||
}
|
||||
});
|
||||
layui.table.reload('detail', { where: { "Searcher.SysDictTypeId": id , "page": false} });
|
||||
layui.table.reload('SysDictData', { where: { "Searcher.SysDictTypeId": id, "page": false } });
|
||||
}
|
||||
|
||||
function CreateDictData() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
@model HHWMS.Web.TaskHeaderListVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="header">
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="TaskHeader">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:textbox field="Searcher.TaskNo" />
|
||||
@ -13,13 +13,13 @@
|
||||
<wt:combobox field="Searcher.Status" empty-text="@Localizer["Sys.All"]" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" id="header" url="/taskManage/TaskHeader/Search" limit="7" />
|
||||
<wt:grid vm="@Model.TaskDetails" id="detail" url="/taskManage/TaskDetail/Search2" height="400" />
|
||||
<wt:grid vm="@Model" id="TaskHeader" url="/taskManage/TaskHeader/Search" limit="7" />
|
||||
<wt:grid vm="@Model.TaskDetails" id="TaskDetail" url="/taskManage/TaskDetail/Search2" height="400" />
|
||||
|
||||
<script>
|
||||
var headerId = 0;
|
||||
function details(id) {
|
||||
headerId = id;
|
||||
layui.table.reload('detail', { where: { "Searcher.TaskHeaderId": id } });
|
||||
layui.table.reload('TaskDetail', { where: { "Searcher.TaskHeaderId": id } });
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1009,7 +1009,7 @@
|
||||
<value>执行</value>
|
||||
</data>
|
||||
<data name="TaskHeader.Cancel" xml:space="preserve">
|
||||
<value>取消</value>
|
||||
<value>取消任务</value>
|
||||
</data>
|
||||
<data name="TaskDetail.Status" xml:space="preserve">
|
||||
<value>状态</value>
|
||||
@ -1371,4 +1371,4 @@
|
||||
<data name="ShipmentHeader.StartOut" xml:space="preserve">
|
||||
<value>启动出库</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@ -29,9 +29,9 @@
|
||||
}
|
||||
//{
|
||||
// "Key": "default",
|
||||
// "Value": "Data Source=./Vehicle_DB",
|
||||
// "Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
|
||||
// "DbContext": "DataContext",
|
||||
// "DBType": "SQLite" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
//}
|
||||
],
|
||||
"CookiePre": "HHWMS", //cookie前缀
|
||||
@ -39,7 +39,7 @@
|
||||
"EnableTenant": false, //是否启动多租户
|
||||
"SyncDb": true, //是否自动同步数据库
|
||||
"EncryptKey": "", //加密密钥
|
||||
"PageMode": "Single", //页面显示模式,Single或者Tab
|
||||
"PageMode": "Tab", //页面显示模式,Single或者Tab
|
||||
"TabMode": "Simple", //Tab页显示方式,Default或者Simple
|
||||
"IsFilePublic": true,
|
||||
"ErrorHandler": "/_Framework/Error",
|
||||
@ -105,7 +105,7 @@
|
||||
"Address": "https://api.github.com"
|
||||
},
|
||||
"WCS": {
|
||||
"Address": "http://10.18.97.193:1111/api/WcsWebApi/"
|
||||
"Address": "http://10.18.97.205:1111/api/WcsWebApi/"
|
||||
}
|
||||
},
|
||||
"AppSettings": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user