新增 hiprint 打印设计
This commit is contained in:
1 parent
aacf491051
commit
79c22c6348
27 files changed
+11515
-235
No files matched your search
@@ -12,7 +12,7 @@ using WalkingTec.Mvvm.Mvc;
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("configs")]
|
||||
[ActionDescription("打印管理")]
|
||||
[ActionDescription("打印设计")]
|
||||
public partial class PrintController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
@@ -27,62 +27,9 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var inv = _unitwork.Find<Inventory>(x => x.TaskStatus != InventoryTaskStatus.任务中)
|
||||
.ToList()
|
||||
.GroupBy(x => x.ContainerCode);
|
||||
var vm = Wtm.CreateVM<ContainerListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion Search
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult ScanCode(string code)
|
||||
{
|
||||
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(code));
|
||||
if (material == null)
|
||||
{
|
||||
return JsonMore(null, 500, $"二维码{code}不存在!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonMore(null);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult GenCode(string code, int num = 1)
|
||||
{
|
||||
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(code));
|
||||
if (material == null)
|
||||
{
|
||||
return JsonMore(null, 500, $"二维码{code}不存在!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var materialQrList = new List<MaterialQr>();
|
||||
var printList = new List<dynamic>();
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
var prefix = code.Split("@")[1].Substring(2);
|
||||
var uniqueCode = _unitwork.GetSerialNumber(prefix, length: 8);
|
||||
//var uniqueCode = prefix + unique;
|
||||
|
||||
materialQrList.Add(new MaterialQr
|
||||
{
|
||||
QRCode = code,
|
||||
UniqueCode = uniqueCode,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode
|
||||
});
|
||||
printList.Add(new
|
||||
{
|
||||
UniqueCode = uniqueCode,
|
||||
Batch = material.Batch
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd(materialQrList.ToArray());
|
||||
return JsonMore(printList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user