Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c67f0fb317 | ||
|
|
ec33bdf946 | ||
|
|
0d346bd155 | ||
|
|
6897508f8d |
No files matched your search
@@ -1,4 +1,6 @@
|
||||
# wtm custom
|
||||
.DS_Store
|
||||
Desktop.ini
|
||||
|
||||
demo/WalkingTec.Mvvm.Demo/wwwroot/layuiadminsrc
|
||||
.Publish/
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
// 下发盘料出库
|
||||
var plcTaskList = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails)
|
||||
.ToList();
|
||||
if (plcTaskList.Any())
|
||||
@@ -236,7 +236,7 @@ namespace HHWMS.Web
|
||||
// 更新目的仓位
|
||||
var to = _unitwork.FindSingle<Location>(x => x.ContiguousCode == task.ToLocation
|
||||
&& x.Type.Equals(LocationTypeEnum.机械臂工位))?.Code;
|
||||
plrTask.ToLocation = to;
|
||||
plrTask.ToLocation += $" {to}";
|
||||
// 更新明细为待下发
|
||||
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Contains(task.ContainerCode));
|
||||
|
||||
@@ -270,8 +270,11 @@ namespace HHWMS.Web
|
||||
{
|
||||
var station = _unitwork.Find<Location>(x => x.Code == task.FromLocation).FirstOrDefault();
|
||||
// 创建料盒入库任务
|
||||
// 查找回库的任务起点,
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation)).ContiguousCode;
|
||||
// 根据子任务容器编码,查找回库的任务起点,(主任务会有多个容器编码)
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x =>
|
||||
x.ContainerCode.Equals(containerCode)
|
||||
&& x.Type == LocationTypeEnum.堆垛机工位
|
||||
).Code;
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
if (task.TaskNo.Contains("PLoop"))
|
||||
{
|
||||
@@ -317,7 +320,7 @@ namespace HHWMS.Web
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (inv != null)
|
||||
{
|
||||
inv.ContainerCode = tolocation.ContainerCode;
|
||||
inv.ContainerCode = tolocation?.ContainerCode;
|
||||
inv.LocationCode = task.ToLocation;
|
||||
inv.Lot = taskde.ToLocation;
|
||||
_unitwork.Update(inv);
|
||||
|
||||
@@ -50,13 +50,13 @@ namespace HHWMS.Web
|
||||
return data?.Text ?? a.ZoneCode;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Code, 120),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
this.MakeGridHeader(x => x.Type,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
||||
return data?.Text ?? a.Type;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
this.MakeGridHeader(x => x.Status,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
@@ -10,7 +11,7 @@ namespace HHWMS.Web
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Location.Type")]
|
||||
public String Type { get; set; }
|
||||
public List<string> Type { get; set; }
|
||||
|
||||
[Display(Name = "Location.Status")]
|
||||
public String Status { get; set; }
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<wt:display field="Entity.ContiguousCode" /> *@
|
||||
</wt:row>
|
||||
|
||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true"/>
|
||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true"/>
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
<wt:combobox field="Searcher.Type" items="Types" />
|
||||
<wt:combobox field="Searcher.Type" items="Types" multi-select="true"/>
|
||||
@*
|
||||
<wt:combobox field="Searcher.Status" items="LocationStatus" />
|
||||
<wt:textbox field="Searcher.Row" />
|
||||
|
||||
+17
-15
@@ -26,27 +26,28 @@ namespace HHWMS.Web
|
||||
protected override IEnumerable<IGridColumn<InventoryTransaction_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<InventoryTransaction_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.Type),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.ZoneCode,120),
|
||||
this.MakeGridHeader(x => x.BillType,120),
|
||||
this.MakeGridHeader(x => x.Type,230),
|
||||
this.MakeGridHeader(x => x.ContainerCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.LocationCode,150),
|
||||
this.MakeGridHeader(x => x.MaterialCode,120),
|
||||
this.MakeGridHeader(x => x.MaterialType,120),
|
||||
this.MakeGridHeader(x => x.MaterialName,120),
|
||||
this.MakeGridHeader(x => x.MaterialSpec,120),
|
||||
this.MakeGridHeader(x => x.MaterialUnit,120),
|
||||
this.MakeGridHeader(x => x.Batch,120),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.ManufactureDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.BillType),
|
||||
this.MakeGridHeader(x => x.SourceCode),
|
||||
this.MakeGridHeader(x => x.BillCode),
|
||||
this.MakeGridHeader(x => x.BillDetailId),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.Status).SetHide(),
|
||||
this.MakeGridHeader(x => x.CreateTime,200),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -93,6 +94,7 @@ namespace HHWMS.Web
|
||||
BillCode = x.BillCode,
|
||||
BillDetailId = x.BillDetailId,
|
||||
Status = x.Status,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
[Display(Name = "InventoryTransaction.Type")]
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String Type { get; set; }
|
||||
[Display(Name = "Task.ContainerCode")]
|
||||
public String ContainerCode { get; set; }
|
||||
|
||||
@@ -57,30 +57,31 @@ namespace HHWMS.Web
|
||||
}),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.ContainerCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.LocationCode,150),
|
||||
this.MakeGridHeader(x => x.MaterialCode,120),
|
||||
this.MakeGridHeader(x => x.MaterialType,120),
|
||||
this.MakeGridHeader(x => x.MaterialName,120),
|
||||
this.MakeGridHeader(x => x.MaterialSpec,120),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.Batch,120),
|
||||
this.MakeGridHeader(x => x.Lot,80),
|
||||
//this.MakeGridHeader(x => x.ManufactureDate),
|
||||
//this.MakeGridHeader(x => x.ExpirationDate),
|
||||
//this.MakeGridHeader(x => x.CompanyCode),
|
||||
//this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.TaskQty).SetHide(),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Qty,80),
|
||||
//this.MakeGridHeader(x => x.SourceCode),
|
||||
//this.MakeGridHeader(x => x.ReceiptCode),
|
||||
//this.MakeGridHeader(x => x.ReceiptDetailId),
|
||||
//this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.TaskStatus)
|
||||
this.MakeGridHeader(x => x.TaskStatus,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = InventoryTaskStatus.FirstOrDefault(x => x.Value.ToString() == a.TaskStatus);
|
||||
return data?.Text ?? a.TaskStatus;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -122,7 +123,7 @@ namespace HHWMS.Web
|
||||
.CheckContain(Searcher.Lot, x => x.Lot)
|
||||
.CheckContain(Searcher.SourceCode, x => x.SourceCode)
|
||||
.CheckContain(Searcher.ReceiptCode, x => x.ReceiptCode)
|
||||
.CheckContain(Searcher.TaskStatus, x => x.TaskStatus)
|
||||
.CheckContain(Searcher.TaskStatus, x => x.Status)
|
||||
.Select(x => new Inventory_View
|
||||
{
|
||||
ID = x.ID,
|
||||
@@ -148,6 +149,7 @@ namespace HHWMS.Web
|
||||
ReceiptDetailId = x.ReceiptDetailId,
|
||||
Status = x.Status,
|
||||
TaskStatus = x.TaskStatus,
|
||||
CreateTime = x.CreateTime,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
|
||||
namespace HHWMS.Web
|
||||
@@ -14,13 +15,10 @@ namespace HHWMS.Web
|
||||
{
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public String LocationCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.TaskStatus", Description = "任务状态")]
|
||||
public string TaskStatus { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<wt:textbox field="Searcher.Lot" />
|
||||
<wt:textbox field="Searcher.SourceCode" />
|
||||
<wt:textbox field="Searcher.ReceiptCode" />
|
||||
*@
|
||||
<wt:textbox field="Searcher.Status" /> *@
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/inventory/Inventory/Search"/>
|
||||
@@ -267,7 +267,8 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
return JsonMore(null, 500, $"数量必须大于0!");
|
||||
}
|
||||
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
|
||||
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode)
|
||||
&& x.ReceiptHeaderId.ToString() == code);
|
||||
if (receiptDetail != null)
|
||||
{
|
||||
receiptDetail.Qty = qty;
|
||||
|
||||
@@ -142,6 +142,27 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
// 先捡货,后入库
|
||||
if (_unitWork.IsExit<Inventory>(x => !string.IsNullOrEmpty(x.SourceCode)
|
||||
&& x.LocationCode == data.First().BoxCode))
|
||||
{
|
||||
return JsonMore(null, 500, "周转箱存在未捡货任务,请捡货完成后再执行入库操作!");
|
||||
}
|
||||
/*
|
||||
//单据明细验证
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
|
||||
.Contains(x.UniqueCode)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
var msg = "以下明细不是新建状态:\n";
|
||||
foreach (var errDetail in errDetails)
|
||||
{
|
||||
msg += $"{errDetail.UniqueCode}\n";
|
||||
}
|
||||
return JsonMore(null, 500, msg);
|
||||
}*/
|
||||
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
@@ -193,8 +214,11 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
|
||||
var boxcode = data.First().BoxCode;
|
||||
//创建入库任务
|
||||
var invList = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(boxcode))
|
||||
//根据提交的uniquecode,创建入库任务
|
||||
var invList = _unitWork.Find<Inventory>(x =>
|
||||
data.Select(y => y.UniqueCode).ToList().Contains(x.UniqueCode)
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中
|
||||
&& x.ContainerCode.Equals(boxcode))
|
||||
.ToList();
|
||||
if (invList.Count == 0)
|
||||
{
|
||||
|
||||
@@ -159,12 +159,28 @@ public class ReceiptSLInController : BaseController
|
||||
{
|
||||
try
|
||||
{
|
||||
/*
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
|
||||
.Contains(x.UniqueCode)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
var msg = "以下明细不是新建状态:\n";
|
||||
foreach (var errDetail in errDetails)
|
||||
{
|
||||
msg += $"{errDetail.UniqueCode}\n";
|
||||
}
|
||||
return JsonMore(null, 500, msg);
|
||||
}
|
||||
*/
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建);
|
||||
if (receipt != null)
|
||||
{
|
||||
if (receipt.Status == ReceiptStatusEnum.收完) continue;
|
||||
|
||||
@@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -71,12 +73,27 @@ public class ReceiptShelfInController : BaseController
|
||||
{
|
||||
try
|
||||
{
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x =>
|
||||
data.Select(y => y.ID).ToList().Contains(x.ID)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
var msg = "以下明细不是新建状态:\n";
|
||||
foreach (var errDetail in errDetails)
|
||||
{
|
||||
msg += $"{errDetail.UniqueCode}\n";
|
||||
}
|
||||
return JsonMore(null, 500, msg);
|
||||
}
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建
|
||||
);
|
||||
if (receipt != null)
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
@@ -88,7 +105,7 @@ public class ReceiptShelfInController : BaseController
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!");
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的新建状态明细!");
|
||||
}
|
||||
|
||||
// 新建库存
|
||||
@@ -110,29 +127,28 @@ public class ReceiptShelfInController : BaseController
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
}); ;
|
||||
|
||||
foreach (var inv in invList)
|
||||
});
|
||||
}
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
{
|
||||
BillType = "in",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
BillType = "in",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
_unitWork.BatchAdd(invList.ToArray());
|
||||
_unitWork.BatchAdd(listInvtran.ToArray());
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<el-table-column label="料盘尺寸" align="center" prop="size" :formatter="sizeFormatter"></el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float:right">
|
||||
<el-button type="primary" @@click="onSubmit">绑定入库</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定入库</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
@* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@
|
||||
</el-form-item>
|
||||
@@ -107,7 +107,8 @@
|
||||
boxCode: [
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
disabledButton : false
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -132,7 +133,16 @@
|
||||
//绑定单据
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -140,6 +150,8 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: '入库成功!',
|
||||
@@ -149,12 +161,14 @@
|
||||
}
|
||||
else {
|
||||
_this.$message({
|
||||
message: '入库失败!',
|
||||
message: '入库失败!'+json.Msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: '入库失败!',
|
||||
type: 'error'
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @@click="onSubmit">绑定</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
<el-button type="success" @@click="back" :disabled="disabledbackbutton">回库</el-button>
|
||||
</el-form-item>
|
||||
@@ -102,6 +102,7 @@
|
||||
uniqueCode: "",
|
||||
isFull: false
|
||||
},
|
||||
disabledButton : false,
|
||||
disabledbackbutton: true,// true不可回库,false可回库
|
||||
boxSize: [
|
||||
{ label: "8mm", value: "8" },
|
||||
@@ -223,7 +224,16 @@
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -231,6 +241,8 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptSLIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "绑定成功!",
|
||||
@@ -249,6 +261,8 @@
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: "绑定失败!",
|
||||
type: "error",
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @@click="onSubmit">入库</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">入库</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -74,7 +74,8 @@
|
||||
uniqueCode: "",
|
||||
locationCode: ""
|
||||
},
|
||||
bindingData: []
|
||||
bindingData: [],
|
||||
disabledButton : false
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -97,7 +98,16 @@
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -105,6 +115,8 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptShelfIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "入库成功!",
|
||||
@@ -112,13 +124,15 @@
|
||||
_this.bindingData = [];
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "入库失败!",
|
||||
message: "入库失败!"+json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: "入库失败!",
|
||||
type: "error",
|
||||
@@ -135,7 +149,14 @@
|
||||
// 扫描唯一码
|
||||
scanUniqueCode(data) {
|
||||
var _this = this;
|
||||
|
||||
if (_this.form.locationCode == ""){
|
||||
_this.$message({
|
||||
message: "位置不能为空!",
|
||||
type: "warning",
|
||||
duration: "1000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量
|
||||
var isExit = this.bindingData.findIndex(function (value) {
|
||||
return value.uniqueCode == data;
|
||||
@@ -164,6 +185,7 @@
|
||||
} else {
|
||||
// 3.已扫描增加
|
||||
_this.bindingData.push({
|
||||
id:json.Data.ID,
|
||||
receiptCode: json.Data.ReceiptHeaderId,
|
||||
uniqueCode: json.Data.UniqueCode,
|
||||
materialCode: json.Data.MaterialCode,
|
||||
|
||||
+1
@@ -89,6 +89,7 @@ namespace HHWMS.Web
|
||||
var query = DC.Set<ShipmentDetailHistory>()
|
||||
.CheckEqual(Searcher.ShipmentHeaderHistoryId, x=>x.ShipmentHeaderHistoryId)
|
||||
.CheckContain(Searcher.ZoneCode, x=>x.ZoneCode)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialType, x=>x.MaterialType)
|
||||
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
|
||||
|
||||
@@ -66,16 +66,17 @@ namespace HHWMS.Web
|
||||
if (count > 0)
|
||||
{
|
||||
var taskList = CreateWCSTask(task, _unitwork);
|
||||
|
||||
foreach (var item in taskList)
|
||||
{
|
||||
task.ErrorMsg += JsonConvert.SerializeObject(item);
|
||||
// 调用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));
|
||||
@@ -107,12 +108,12 @@ namespace HHWMS.Web
|
||||
_unitwork.Update(begin);
|
||||
_unitwork.Update(end);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// task.ErrorMsg += $",任务下发失败,失败原因:{res.Msg}";
|
||||
// _unitwork.Update(task);
|
||||
// continue;
|
||||
// }
|
||||
else
|
||||
{
|
||||
task.ErrorMsg += $",任务下发失败,失败原因:{res.Msg}";
|
||||
_unitwork.Update(task);
|
||||
continue;
|
||||
}
|
||||
//Task.Delay(500);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -147,7 +148,9 @@ namespace HHWMS.Web
|
||||
Wtm.DoLog("任务下发", ActionLogTypesEnum.Job, "SendWcsJob");
|
||||
#endregion 更新时间
|
||||
}
|
||||
catch { }
|
||||
catch(Exception ex) {
|
||||
Wtm.DoLog(ex.Message, ActionLogTypesEnum.Job, "SendWcsJob");
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -240,7 +243,7 @@ namespace HHWMS.Web
|
||||
newTask.Station = "2";
|
||||
_unitwork.Add(newTask);
|
||||
|
||||
task.ContainerCode += container.ContainerCode;
|
||||
task.ContainerCode += $" {container.ContainerCode}";
|
||||
// 更新库位
|
||||
container.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(container);
|
||||
@@ -380,7 +383,10 @@ namespace HHWMS.Web
|
||||
if (task != null)
|
||||
{
|
||||
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code) || task.ToLocation.Equals(x.Code)).ToList();
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code)
|
||||
|| task.ToLocation.Equals(x.Code)
|
||||
|| "G1,G2,T".Contains(x.Type)).ToList();
|
||||
|
||||
var begin = locationList.FirstOrDefault(x => x.Code.Equals(task.FromLocation));
|
||||
var end = locationList.FirstOrDefault(x => x.Code.Equals(task.ToLocation));
|
||||
// 根据不同任务类型 创建任务
|
||||
@@ -418,6 +424,11 @@ namespace HHWMS.Web
|
||||
{
|
||||
if (container.Any(x => x == item.ContainerCode))
|
||||
{
|
||||
var g1 = locationList.First(x => x.ContainerCode.Equals(item.ContainerCode)
|
||||
&& x.Type.Equals(LocationTypeEnum.堆垛机工位));
|
||||
|
||||
end = locationList.First(x => x.Code.Equals(g1.ContiguousCode));
|
||||
|
||||
taskInfoList.Add(new TaskInfo
|
||||
{
|
||||
TaskId = $"{task.TaskNo}-{item.FromLocation}",
|
||||
|
||||
@@ -39,14 +39,12 @@ namespace HHWMS.Web
|
||||
{
|
||||
foreach (var shipment in Shipments)
|
||||
{
|
||||
var shipmentDetails = shipment.ShipmentDetails
|
||||
.Where(x => x.Status.Equals(ShipStatusEnum.新建)).ToList();
|
||||
var shipmentDetails = shipment.ShipmentDetails.Where(x => x.Status.Equals(ShipStatusEnum.新建)).ToList();
|
||||
foreach (var shipmentDetail in shipmentDetails)
|
||||
{
|
||||
var inventorys = _unitwork.Find<Inventory>(x =>
|
||||
x.UniqueCode == shipmentDetail.UniqueCode
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务
|
||||
&& x.ZoneCode != ZoneCodeEnum.货架库).ToList();
|
||||
var inventorys = _unitwork.Find<Inventory>(x => x.UniqueCode == shipmentDetail.UniqueCode
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务
|
||||
&& x.ZoneCode != ZoneCodeEnum.货架库).ToList();
|
||||
if (inventorys.Count <= 0)
|
||||
{
|
||||
continue;
|
||||
@@ -64,7 +62,6 @@ namespace HHWMS.Web
|
||||
|
||||
shipmentDetail.Status = ShipStatusEnum.分配完成;
|
||||
}
|
||||
|
||||
shipmentDetail.UpdateTime = DateTime.Now;
|
||||
shipmentDetail.UpdateBy = "wmsjob";
|
||||
}
|
||||
@@ -84,18 +81,18 @@ namespace HHWMS.Web
|
||||
}
|
||||
|
||||
var inTaskContainerList = _unitwork.Find<TaskHeader>(x => x.TaskType == TaskTypeEnum.盘料盒入库
|
||||
|| x.TaskType == TaskTypeEnum.盘料入库
|
||||
|| x.TaskType == TaskTypeEnum.散料盒入库)
|
||||
|| x.TaskType == TaskTypeEnum.盘料入库
|
||||
|| x.TaskType == TaskTypeEnum.散料盒入库)
|
||||
.Select(x => x.ContainerCode)
|
||||
.ToList();
|
||||
//出库库存通过托盘号分组
|
||||
var lockInvs = _unitwork.Find<Inventory>(x => x.TaskStatus == InventoryTaskStatus.任务中
|
||||
&& !"L01,L02".Contains(x.LocationCode)
|
||||
&& !inTaskContainerList.Contains(x.LocationCode))
|
||||
.ToList();
|
||||
&& !"L01,L02".Contains(x.LocationCode)
|
||||
&& !inTaskContainerList.Contains(x.LocationCode))
|
||||
.ToList();
|
||||
shiInventorys.AddRange(lockInvs);
|
||||
//已生成任务的库存不再生成任务
|
||||
var taskUniques = _unitwork.Find<TaskDetail>(x => x.Status >= TaskStatusEnum.新建)
|
||||
var taskUniques = _unitwork.Find<TaskDetail>(x => x.Status > TaskStatusEnum.新建)
|
||||
.Select(x => x.UniqueCode).ToList();
|
||||
var taskInvs = _unitwork.Find<Inventory>(x => taskUniques.Contains(x.UniqueCode)).ToList();
|
||||
var newList = shiInventorys.Except(taskInvs).ToList();
|
||||
@@ -103,29 +100,19 @@ namespace HHWMS.Web
|
||||
var inventoryList = newList.GroupBy(x => x.ContainerCode)
|
||||
.ToList();
|
||||
|
||||
// 堆垛机工位点
|
||||
var gLocDict = new Dictionary<int, dynamic>();
|
||||
gLocDict.Add(1, new { Row = 1, GLoc = "L01-01-34-02", TLoc = "L01-02" });
|
||||
gLocDict.Add(2, new { Row = 3, GLoc = "L01-02-34-02", TLoc = "L01-01" });
|
||||
|
||||
//散料库
|
||||
if (inventoryList.Any(x => x.Key.Contains("C")))
|
||||
{
|
||||
foreach (var item in inventoryList.Where(x => x.Key.Contains("C")))
|
||||
{
|
||||
//出库托盘
|
||||
Location location = _unitwork
|
||||
.Find<Location>(x => x.Code == item.Key && x.Status != LocationStatus.任务锁)
|
||||
.FirstOrDefault();
|
||||
Location location = _unitwork.Find<Location>(x => x.Code == item.Key && x.Status != LocationStatus.任务锁).FirstOrDefault();
|
||||
if (location == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// 查询目的地站台是否可用
|
||||
var station = _unitwork.Find<Location>(x =>
|
||||
x.Row == location.Row && x.Type == LocationTypeEnum.散料库站台 &&
|
||||
string.IsNullOrWhiteSpace(x.ContainerCode)).FirstOrDefault();
|
||||
var station = _unitwork.Find<Location>(x => x.Row == location.Row && x.Type == LocationTypeEnum.散料库站台 && string.IsNullOrEmpty(x.ContainerCode)).FirstOrDefault();
|
||||
if (station == null)
|
||||
{
|
||||
continue;
|
||||
@@ -134,8 +121,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
//判断是否已经有目的站台的出库任务
|
||||
TaskHeader taskHeader = _unitwork.Find<TaskHeader>(x =>
|
||||
x.ToLocation == station.Code && x.TaskType == TaskTypeEnum.散料盒出库)
|
||||
.FirstOrDefault();
|
||||
x.ToLocation == station.Code && x.TaskType == TaskTypeEnum.散料盒出库).FirstOrDefault();
|
||||
if (taskHeader != null)
|
||||
{
|
||||
continue;
|
||||
@@ -162,157 +148,11 @@ namespace HHWMS.Web
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//盘料库
|
||||
if (inventoryList.Any(x => x.Key.Contains("L")))
|
||||
{
|
||||
foreach (var item in inventoryList.Where(x => x.Key.Contains("L")))
|
||||
{
|
||||
#region new task flow
|
||||
|
||||
//判断是否存在此托盘入库任务
|
||||
// 存在 跳过
|
||||
if (_unitwork.IsExit<TaskHeader>(x =>
|
||||
x.ContainerCode.Equals(item.Key)
|
||||
&& (x.TaskType == TaskTypeEnum.盘料入库
|
||||
|| x.TaskType == TaskTypeEnum.盘料盒入库)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// 不用判断是否存在出库任务,可创建多个相同容器的盘料出库任务,存在盘料盒出库也无所谓
|
||||
|
||||
// 根据库存的库位信息,查找盘料出库的起点站台 堆垛机工位
|
||||
var invLoc = _unitwork.FindSingle<Location>(x => x.Code == item.Key);
|
||||
|
||||
var taskHeader = new TaskHeader();
|
||||
taskHeader.TaskDetails = new List<TaskDetail>();
|
||||
|
||||
taskHeader.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
taskHeader.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||
taskHeader.TaskType = TaskTypeEnum.盘料出库;
|
||||
taskHeader.Status = TaskStatusEnum.新建;
|
||||
taskHeader.ContainerCode = item.Key;
|
||||
taskHeader.Priority = 100;
|
||||
taskHeader.FromLocation = gLocDict.First(x => x.Value.Row == invLoc.Row).Value.TLoc;
|
||||
taskHeader.ToLocation = item.First().Flag == 8 ? "L01" : "L02";
|
||||
taskHeader.CreateTime = DateTime.Now;
|
||||
taskHeader.CreateBy = "wmsjob";
|
||||
|
||||
// 创建任务明细
|
||||
foreach (var inventory in item)
|
||||
{
|
||||
if (!taskHeader.TaskDetails.Any(x => x.UniqueCode.Equals(inventory.UniqueCode)))
|
||||
taskHeader.TaskDetails.Add(new TaskDetail
|
||||
{
|
||||
UniqueCode = inventory.UniqueCode,
|
||||
Lot = $"{Convert.ToInt32(invLoc.Length)}-{taskHeader.ToLocation}",
|
||||
FromLocation = inventory.Lot,
|
||||
ToLocation = "",
|
||||
Status = TaskStatusEnum.新建,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
|
||||
_unitwork.Add(taskHeader);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
// 根据盘料出库,生成盘料盒出库任务,并更新盘料出库明细的 出库库位
|
||||
var plcTaskList = _unitwork.Find<TaskHeader>(x =>
|
||||
x.TaskType == TaskTypeEnum.盘料出库
|
||||
&& x.Status == TaskStatusEnum.新建)
|
||||
.Include(x => x.TaskDetails)
|
||||
.ToList();
|
||||
|
||||
// 查询当前工位的状态
|
||||
var workLocList = _unitwork.Find<Location>(x =>
|
||||
"L01,L02,L01-01-34-02,L01-02-34-02".Contains(x.Code)
|
||||
).ToList();
|
||||
|
||||
|
||||
foreach (var plcTask in plcTaskList)
|
||||
{
|
||||
|
||||
var lLoc = workLocList.First(x => x.Code.Equals(plcTask.ToLocation));
|
||||
var container = _unitwork.FindSingle<Location>(x => x.Code.Equals(plcTask.ContainerCode));
|
||||
|
||||
// 判断是否已存在盘料盒出库任务,或者盘料盒已在堆垛机工位 L01-34-02/L02-34-02
|
||||
var isOut = workLocList.Any(x => x.ContainerCode.Equals(plcTask.ContainerCode));
|
||||
string toLocCode = gLocDict.First(x => x.Value.Row == container.Row).Value.GLoc;
|
||||
|
||||
// 存在去相同工位点的 盘料盒出库任务 跳过(保持一个工位只有一条盘料盒出库任务)
|
||||
// 工位有货 也跳过
|
||||
var c1 = _unitwork.IsExit<TaskHeader>(x =>
|
||||
x.TaskType == TaskTypeEnum.盘料盒出库
|
||||
&& x.ContainerCode != plcTask.ContainerCode
|
||||
&& x.ToLocation == toLocCode);
|
||||
var c2 = workLocList.Any(x => x.Code == toLocCode
|
||||
&& !string.IsNullOrWhiteSpace(x.ContainerCode)
|
||||
&& !x.ContainerCode.Equals(plcTask.ContainerCode));
|
||||
if(c1 || c2)
|
||||
continue;
|
||||
|
||||
if (!plcTask.TaskDetails.Any(x =>
|
||||
x.Status == TaskStatusEnum.新建 && string.IsNullOrWhiteSpace(x.ToLocation))) continue;
|
||||
|
||||
if (_unitwork.IsExit<TaskHeader>(x =>
|
||||
x.ContainerCode.Equals(plcTask.ContainerCode)
|
||||
&& x.TaskType == TaskTypeEnum.盘料盒出库)
|
||||
||
|
||||
isOut
|
||||
)
|
||||
{
|
||||
// 更新任务明细的 location ,status一般在盘料盒出库完成后更新为 待下发
|
||||
// 1. 计算周转箱可用层数
|
||||
var canUse = CalCanUse(Convert.ToInt32(lLoc.Length), plcTask.ToLocation, _unitwork);
|
||||
foreach (var detail in plcTask.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建
|
||||
&& string.IsNullOrWhiteSpace(x.ToLocation)))
|
||||
{
|
||||
if (canUse.Length > 0)
|
||||
{
|
||||
// 2.更新目标库位
|
||||
detail.ToLocation = canUse.First().ToString();
|
||||
detail.UpdateTime = DateTime.Now;
|
||||
|
||||
canUse = canUse.Where(x => x != canUse.First()).ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_unitwork.Update(plcTask);
|
||||
}
|
||||
else if (!isOut && !_unitwork.IsExit<TaskHeader>(x =>
|
||||
x.ToLocation.Equals(toLocCode)))
|
||||
{
|
||||
// 不存在盘料盒出库任务,创建盘料盒出库任务
|
||||
// 判断堆垛机工位是否有货,并且没有其他去该工位的盘料盒出库
|
||||
|
||||
var pTask = new TaskHeader
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.盘料库,
|
||||
TaskNo = _unitwork.GetSerialNumber("Out"),
|
||||
TaskType = TaskTypeEnum.盘料盒出库,
|
||||
ContainerCode = plcTask.ContainerCode,
|
||||
FromLocation = plcTask.ContainerCode,
|
||||
ToLocation = toLocCode,
|
||||
Station = "1",
|
||||
Status = TaskStatusEnum.待下发,
|
||||
Priority = 0,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = "wmsjob"
|
||||
};
|
||||
_unitwork.Add(pTask);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
var task = new TaskHeader();
|
||||
task.TaskDetails = new List<TaskDetail>();
|
||||
var inv = item.FirstOrDefault();
|
||||
@@ -524,7 +364,6 @@ namespace HHWMS.Web
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
tran.Commit();
|
||||
}
|
||||
catch
|
||||
@@ -538,26 +377,19 @@ namespace HHWMS.Web
|
||||
var job = _unitwork.FindSingle<SysJob>(x => x.JobName == context.JobDetail.Key.Name);
|
||||
if (job != null)
|
||||
{
|
||||
job.LastFireTime =
|
||||
TimeZoneInfo.ConvertTimeFromUtc(context.FireTimeUtc.DateTime, TimeZoneInfo.Local);
|
||||
job.LastFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.FireTimeUtc.DateTime, TimeZoneInfo.Local);
|
||||
// 只执行一次 没有下次执行时间
|
||||
if (context.NextFireTimeUtc != null)
|
||||
{
|
||||
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime,
|
||||
TimeZoneInfo.Local);
|
||||
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime, TimeZoneInfo.Local);
|
||||
}
|
||||
|
||||
_unitwork.Update<SysJob>(job);
|
||||
}
|
||||
|
||||
Wtm.DoLog("出库分解", ActionLogTypesEnum.Job, "SendWmsJob");
|
||||
|
||||
#endregion 更新时间
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Wtm.DoLog("出库分解", ActionLogTypesEnum.Job, "SendWmsJob", result:ex.Message);
|
||||
}
|
||||
catch { }
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -741,8 +573,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
var used1 = _unitwork.Find<Inventory>(x => x.LocationCode.Equals(code))
|
||||
.Select(x => int.Parse(x.Lot)).ToArray();
|
||||
var used2 = _unitwork.Find<TaskDetail>(x => x.Lot.Contains(code)
|
||||
&& !string.IsNullOrWhiteSpace(x.ToLocation))
|
||||
var used2 = _unitwork.Find<TaskDetail>(x => x.Lot.Contains(code))
|
||||
.Select(x => int.Parse(x.ToLocation)).ToArray();
|
||||
var used = used1.Union(used2);
|
||||
var caseList = Enumerable.Range(1, length).ToArray();
|
||||
|
||||
+2
@@ -12,7 +12,9 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class TaskDetailHistorySearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public List<ComboSelectListItem> AllTaskHeaders { get; set; }
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public int? TaskHeaderId { get; set; }
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace HHWMS.Web
|
||||
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<TaskDetail>()
|
||||
.CheckEqual(Searcher.TaskHeaderId,x => x.TaskHeaderId)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.FromLocation, x=>x.FromLocation)
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class TaskDetailSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public List<ComboSelectListItem> AllTaskHeaders { get; set; }
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
@@ -24,10 +26,10 @@ namespace HHWMS.Web
|
||||
public String FromLocation { get; set; }
|
||||
[Display(Name = "Task.ToLocation")]
|
||||
public String ToLocation { get; set; }
|
||||
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
AllTaskHeaders = DC.Set<TaskHeader>().GetSelectListItems(Wtm, y => y.TaskNo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -33,16 +33,17 @@ namespace HHWMS.Web
|
||||
{
|
||||
return new List<GridColumn<TaskHeaderHistory_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.TaskNo),
|
||||
this.MakeGridHeader(x => x.TaskType),
|
||||
this.MakeGridHeader(x => x.FromLocation),
|
||||
this.MakeGridHeader(x => x.ToLocation),
|
||||
this.MakeGridHeader(x => x.TaskNo).SetWidth(220),
|
||||
this.MakeGridHeader(x => x.TaskType,150),
|
||||
this.MakeGridHeader(x => x.FromLocation,150),
|
||||
this.MakeGridHeader(x => x.ToLocation,150),
|
||||
this.MakeGridHeader(x => x.Station),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.ContainerCode,150),
|
||||
this.MakeGridHeader(x => x.RoadWay).SetHide(),
|
||||
this.MakeGridHeader(x => x.Priority).SetHide(),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.Status,150),
|
||||
this.MakeGridHeader(x => x.ErrorMsg),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -72,6 +73,7 @@ namespace HHWMS.Web
|
||||
Priority = x.Priority,
|
||||
Status = x.Status,
|
||||
ErrorMsg = x.ErrorMsg,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.Status, 150),
|
||||
this.MakeGridHeader(x => x.CreateTime, 150).SetHide(),
|
||||
this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -97,6 +98,7 @@ namespace HHWMS.Web
|
||||
Priority = x.Priority,
|
||||
Status = x.Status,
|
||||
ErrorMsg = x.ErrorMsg,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderByDescending(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.FromLocation" />
|
||||
<wt:textbox field="Searcher.ToLocation" />
|
||||
</wt:row>
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
|
||||
<wt:textbox field="Searcher.UniqueCode"/>
|
||||
<wt:textbox field="Searcher.MaterialCode"/>
|
||||
<wt:textbox field="Searcher.FromLocation"/>
|
||||
<wt:textbox field="Searcher.ToLocation"/>
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/taskManage/TaskDetail/Search"/>
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
@* <wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" /> *@
|
||||
<wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.ContainerCode" />
|
||||
<wt:textbox field="Searcher.FromLocation" />
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace HHWMS.Web
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
|
||||
// ef生成表 添加字段注释,只有本项目的表才添加,需要在DisplayAttribute,添加Description
|
||||
var ddd = modelBuilder.Model.GetEntityTypes();
|
||||
ddd = ddd.Where(x => x.ClrType.FullName.Contains("HHWMS.Web")).ToList();
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace MESTOWMSService
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: materails, result: "error");
|
||||
_wtm.DoLog(ex.Message, ActionLogTypesEnum.Normal, "mes", request: materails, result: "error");
|
||||
return new Result { Status = "N", Message = ex.Message};
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,6 @@ namespace MESTOWMSService
|
||||
{
|
||||
try
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder);
|
||||
var data = JsonConvert.DeserializeObject<MesOut>(outOrder);
|
||||
// 生成出库单和明细
|
||||
var shipment = new ShipmentHeader
|
||||
@@ -102,18 +101,20 @@ namespace MESTOWMSService
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Result { Status = "N", Message = $"物料不存在库内!" };
|
||||
_wtm.DoLog($"{item.SN}物料不存在库内!", ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
return new Result { Status = "N", Message = $"{item.SN}物料不存在库内!" };
|
||||
}
|
||||
}
|
||||
if(shipment.ShipmentDetails.Count > 0)
|
||||
{
|
||||
_unitwork.Add(shipment);
|
||||
}
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder);
|
||||
return new Result();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
_wtm.DoLog(ex.Message, ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
return new Result { Status = "N", Message = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace HHWMS.Web.Models
|
||||
[Display(Name = "Container.LocationCode", Description = "库位编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode", Description = "唯一编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string UniqueCode { get; set; }
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace HHWMS.Web.Models
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string ZoneCode { get; set; }
|
||||
|
||||
[Display(Name = "InventoryTransaction.Type", Description = "交易类型")]
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string Type { get; set; }
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"HHWMS.Web": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
|
||||
|
||||
@@ -22,17 +22,17 @@
|
||||
},
|
||||
|
||||
"Connections": [
|
||||
//{
|
||||
// "Key": "default",
|
||||
// "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||
// "DBType": "mysql"
|
||||
//}
|
||||
{
|
||||
"Key": "default",
|
||||
"Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
|
||||
"DbContext": "DataContext",
|
||||
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
"Value": "Server=127.0.0.1;Port=3306;Database=8wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||
"DBType": "mysql"
|
||||
}
|
||||
// {
|
||||
// "Key": "default",
|
||||
// "Value": "Data Source=.;Initial Catalog=8wms;User=sa;Password=abc123*;Persist Security Info=True",
|
||||
// "DbContext": "DataContext",
|
||||
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
// }
|
||||
//{
|
||||
// "Key": "default",
|
||||
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
|
||||
|
||||
Reference in new issue
Block a user