Compare commits

...

4 Commits

Author SHA1 Message Date
c67f0fb317 MES报错记录 2024-06-07 15:55:57 +08:00
ec33bdf946 点数查询新建状态
散料,盘料取消统一状态检查
货架入,bindingdata 新增id,后台根据id判断单据明细状态
2024-06-02 01:01:03 +08:00
0d346bd155 盘料盒回库任务任务,查堆垛机工位的容器号
盘料入库任务下发,目标仓位根据明细的容器号查找
盘料入库 只新建提交的唯一码
出库单历史添加唯一码查询
2024-05-31 13:32:07 +08:00
6897508f8d 调整了部分页面的查询条件
入库明细状态增加校验,
前端增加loading,禁用按钮,空提交检测
2024-05-29 00:19:43 +08:00
32 changed files with 276 additions and 122 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
# wtm custom
.DS_Store
Desktop.ini
demo/WalkingTec.Mvvm.Demo/wwwroot/layuiadminsrc
.Publish/

View File

@ -201,21 +201,27 @@ namespace HHWMS.Web
if (task.Station == "1")
{
// 下发盘料出库
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
&& x.ContainerCode.Contains(task.ContainerCode))
.Include(x => x.TaskDetails).FirstOrDefault();
if (plrTask != null)
var plcTaskList = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
&& x.ContainerCode.Contains(task.ContainerCode))
.Include(x => x.TaskDetails)
.ToList();
if (plcTaskList.Any())
{
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode)
&& x.ContainerCode.Equals(task.ContainerCode)
&& !string.IsNullOrEmpty(x.ToLocation));
foreach (var detail in details)
foreach (var plcTask in plcTaskList)
{
detail.Status = TaskStatusEnum.待下发;
detail.UpdateTime = DateTime.Now;
var details = plcTask.TaskDetails.Where(x =>
!string.IsNullOrEmpty(x.ContainerCode)
&& x.ContainerCode.Equals(task.ContainerCode)
&& !string.IsNullOrEmpty(x.ToLocation));
foreach (var detail in details)
{
detail.Status = TaskStatusEnum.待下发;
detail.UpdateTime = DateTime.Now;
}
plcTask.Status = TaskStatusEnum.待下发;
_unitwork.Update(plcTask);
}
plrTask.Status = TaskStatusEnum.待下发;
_unitwork.Update(plrTask);
}
}
else if (task.Station == "2")
@ -230,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));
@ -264,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"))
{
@ -311,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);

View File

@ -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);

View File

@ -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; }

View File

@ -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 />

View File

@ -5,7 +5,8 @@
<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" />
<wt:textbox field="Searcher.Line" />

View File

@ -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;

View File

@ -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; }

View File

@ -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.Status, x => x.Status)
.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;

View File

@ -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,8 +15,10 @@ namespace HHWMS.Web
{
[Display(Name = "Task.ZoneCode")]
public String ZoneCode { get; set; }
[Display(Name = "Inventory.LocationCode")]
[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")]

View File

@ -6,7 +6,9 @@
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
<wt:textbox field="Searcher.UniqueCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.Batch" />
<wt:textbox field="Searcher.Batch" />
<wt:combobox field="Searcher.TaskStatus" items="InventoryTaskStatus" />
<wt:textbox field="Searcher.LocationCode" />
@*<wt:textbox field="Searcher.MaterialType" />
<wt:textbox field="Searcher.MaterialName" />
<wt:textbox field="Searcher.MaterialSpec" />

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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());

View File

@ -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'

View File

@ -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",

View File

@ -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,

View File

@ -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)

View File

@ -66,6 +66,7 @@ namespace HHWMS.Web
if (count > 0)
{
var taskList = CreateWCSTask(task, _unitwork);
foreach (var item in taskList)
{
task.ErrorMsg += JsonConvert.SerializeObject(item);
@ -75,7 +76,7 @@ namespace HHWMS.Web
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));
@ -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}",

View File

@ -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; }

View File

@ -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)

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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"/>

View File

@ -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();

View File

@ -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 };
}
}

View File

@ -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; }

View File

@ -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; }

View File

@ -18,7 +18,7 @@
},
"HHWMS.Web": {
"commandName": "Project",
"launchBrowser": true,
"launchBrowser": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"

View File

@ -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",