diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsActionController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsActionController.cs index 8b3ae3db..edbf7792 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsActionController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsActionController.cs @@ -37,12 +37,18 @@ namespace ZR.Admin.WebApi.Controllers [Log(Title = "拼箱", BusinessType = BusinessType.UPDATE)] public IActionResult doConsolidationGoods([FromBody] WmGoodsConsolidationDto parm) { - WmGoodsChangeLog response = _WmGoodsActionService.doConsolidationGoods(parm); - if(response == null) + try { - return ToResponse(new ApiResult(500, "拼箱异常!", "拼箱异常!")); + WmGoodsChangeLog response = _WmGoodsActionService.doConsolidationGoods(parm); + if (response == null) + { + return ToResponse(new ApiResult(500, "拼箱异常!", "拼箱异常!")); + } + return SUCCESS(response); + }catch (Exception ex) + { + return ToResponse(new ApiResult(500, ex.Message, "拼箱异常!")); } - return SUCCESS(response); } /// @@ -53,8 +59,20 @@ namespace ZR.Admin.WebApi.Controllers [Log(Title = "拆箱", BusinessType = BusinessType.UPDATE)] public IActionResult doUnpackingGoods([FromBody] WmGoodsUnpackingDto parm) { - WmGoodsChangeLog response = _WmGoodsActionService.doUnpackingGoods(parm); - return SUCCESS(response); + try + { + WmGoodsChangeLog response = _WmGoodsActionService.doUnpackingGoods(parm); + if (response == null) + { + return ToResponse(new ApiResult(500, "拆箱异常!", "拆箱异常!")); + } + return SUCCESS(response); + } + catch (Exception ex) + { + return ToResponse(new ApiResult(500, ex.Message, "拆箱异常!")); + } + } } } \ No newline at end of file diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs index 999df646..9494e870 100644 --- a/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs @@ -248,6 +248,7 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpPost("doMaterialOut")] + [Log(Title = "出库", BusinessType = BusinessType.INSERT)] public IActionResult DoMaterialOut([FromBody] WmDoMaterialOut_Dto doMaterialOut) { if (doMaterialOut == null || doMaterialOut.ShipmentNum == null) diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmPackageLclController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmPackageLclController.cs new file mode 100644 index 00000000..5c186abf --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmPackageLclController.cs @@ -0,0 +1,108 @@ +using Microsoft.AspNetCore.Mvc; +using ZR.Model.Dto; +using ZR.Service.Business.IBusinessService; +using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Filters; +using ZR.Model.MES.wms.Dto; +using ZR.Service.mes.wms.IService; +using ZR.Model.MES.wms; + +//创建时间:2024-04-18 +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// 拼箱/拆箱待打标签记录表 + /// + [Verify] + [Route("/mes/wm/WmPackageLcl")] + public class WmPackageLclController : BaseController + { + /// + /// 拼箱/拆箱待打标签记录表接口 + /// + private readonly IWmPackageLclService _WmPackageLclService; + + public WmPackageLclController(IWmPackageLclService WmPackageLclService) + { + _WmPackageLclService = WmPackageLclService; + } + + /// + /// 查询拼箱/拆箱待打标签记录表列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "business:wmpackagelcl:list")] + public IActionResult QueryWmPackageLcl([FromQuery] WmPackageLclQueryDto parm) + { + var response = _WmPackageLclService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询拼箱/拆箱待打标签记录表详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "business:wmpackagelcl:query")] + public IActionResult GetWmPackageLcl(string Id) + { + var response = _WmPackageLclService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加拼箱/拆箱待打标签记录表 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "business:wmpackagelcl:add")] + [Log(Title = "拼箱/拆箱待打标签记录表", BusinessType = BusinessType.INSERT)] + public IActionResult AddWmPackageLcl([FromBody] WmPackageLclDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _WmPackageLclService.AddWmPackageLcl(modal); + + return SUCCESS(response); + } + + /// + /// 更新拼箱/拆箱待打标签记录表 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "business:wmpackagelcl:edit")] + [Log(Title = "拼箱/拆箱待打标签记录表", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateWmPackageLcl([FromBody] WmPackageLclDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _WmPackageLclService.UpdateWmPackageLcl(modal); + + return ToResponse(response); + } + + /// + /// 删除拼箱/拆箱待打标签记录表 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "business:wmpackagelcl:delete")] + [Log(Title = "拼箱/拆箱待打标签记录表", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteWmPackageLcl(string ids) + { + // int[] idsArr = Tools.SpitIntArrary(ids); + string[] idsArr = ids.Split(','); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败,Id 不能为空")); } + + var response = _WmPackageLclService.Delete(idsArr); + + return ToResponse(response); + } + } +} \ No newline at end of file diff --git a/ZR.Model/MES/wms/Dto/WmPackageLclDto.cs b/ZR.Model/MES/wms/Dto/WmPackageLclDto.cs new file mode 100644 index 00000000..be1cceda --- /dev/null +++ b/ZR.Model/MES/wms/Dto/WmPackageLclDto.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.MES.wms.Dto +{ + /// + /// 拼箱/拆箱待打标签记录表查询对象 + /// + public class WmPackageLclQueryDto : PagerInfo + { + public string Partnumber { get; set; } + public string PackageCode { get; set; } + public string LocationCode { get; set; } + public int Type { get; set; } + public int Status { get; set; } + } + + /// + /// 拼箱/拆箱待打标签记录表输入输出对象 + /// + public class WmPackageLclDto + { + public string Id { get; set; } + + [Required(ErrorMessage = "零件号不能为空")] + public string Partnumber { get; set; } + + public string Description { get; set; } + + [Required(ErrorMessage = "外箱标签;外箱标签(外箱批次号)不能为空")] + public string PackageCode { get; set; } + + public string SerialNumber { get; set; } + + public string LocationCode { get; set; } + + [Required(ErrorMessage = "零件数不能为空")] + public int GoodsNum { get; set; } = 0; + + public string Team { get; set; } = "C"; + public int Type { get; set; } = 0; + public int Status { get; set; } = 0; + public string Remark { get; set; } = string.Empty; + + public string CreatedBy { get; set; } + + public DateTime? CreatedTime { get; set; } + + public string UpdatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } + + + + } +} \ No newline at end of file diff --git a/ZR.Model/MES/wms/WmPackageLcl.cs b/ZR.Model/MES/wms/WmPackageLcl.cs new file mode 100644 index 00000000..48e6d554 --- /dev/null +++ b/ZR.Model/MES/wms/WmPackageLcl.cs @@ -0,0 +1,88 @@ + +namespace ZR.Model.MES.wms +{ + /// + /// 拼箱/拆箱待打标签记录表 + /// + [SugarTable("wm_package_lcl")] + public class WmPackageLcl + { + /// + /// 编码;雪花id + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false)] + public string Id { get; set; } + + /// + /// 零件号 + /// + public string Partnumber { get; set; } + + /// + /// 外箱标签;外箱标签(干巷外箱批次号) + /// + [SugarColumn(ColumnName = "package_code")] + public string PackageCode { get; set; } + + /// + /// 流水号;外箱标签流水号 + /// + [SugarColumn(ColumnName = "serial_number")] + public string SerialNumber { get; set; } + + /// + /// 库位号 + /// + [SugarColumn(ColumnName = "location_code")] + public string LocationCode { get; set; } + + /// + /// 零件数 + /// + [SugarColumn(ColumnName = "goods_num")] + public int GoodsNum { get; set; } = 0; + + /// + /// 班组 + /// + public string Team { get; set; } = "D"; + + // + /// 标签类别 0-初始状态 1-拼箱 2-拆箱 + /// + public int Type { get; set; } = 0; + + /// + /// 是否已打;0-未打 1-已打 + /// + public int Status { get; set; } = 0; + /// + /// 备注 + /// + public string Remark { get; set; } = string.Empty; + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "cREATED_BY")] + public string CreatedBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "cREATED_TIME")] + public DateTime? CreatedTime { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "uPDATED_BY")] + public string UpdatedBy { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "uPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + + } +} \ No newline at end of file diff --git a/ZR.Service/mes/wms/IService/IWmPackageLclService.cs b/ZR.Service/mes/wms/IService/IWmPackageLclService.cs new file mode 100644 index 00000000..cb7633b5 --- /dev/null +++ b/ZR.Service/mes/wms/IService/IWmPackageLclService.cs @@ -0,0 +1,24 @@ +using System; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.MES.wms; +using System.Collections.Generic; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.mes.wms.IService +{ + /// + /// 拼箱/拆箱待打标签记录表service接口 + /// + public interface IWmPackageLclService : IBaseService + { + PagedInfo GetList(WmPackageLclQueryDto parm); + + WmPackageLcl GetInfo(string Id); + + WmPackageLcl AddWmPackageLcl(WmPackageLcl parm); + + int UpdateWmPackageLcl(WmPackageLcl parm); + + } +} diff --git a/ZR.Service/mes/wms/WmGoodsActionService.cs b/ZR.Service/mes/wms/WmGoodsActionService.cs index ca58fbab..cdeb41f7 100644 --- a/ZR.Service/mes/wms/WmGoodsActionService.cs +++ b/ZR.Service/mes/wms/WmGoodsActionService.cs @@ -15,6 +15,8 @@ using MimeKit.Utils; using System.Collections.Generic; using Org.BouncyCastle.Crypto; using static System.Runtime.InteropServices.JavaScript.JSType; +using Microsoft.AspNetCore.Http.HttpResults; +using System.Text.Json.Nodes; namespace ZR.Service.Business { @@ -62,7 +64,7 @@ namespace ZR.Service.Business secondId = check1.Id; description += package.PatchCode + " 数量:" + package.Quantity + ","; } - // 第二箱数量为正数且比箱子总数量小 + // 如果PDA所填合并的数量为正数且比次箱子的总数量小 if (num == 2 && secondNum < package.Quantity && secondNum > 0) { isDelete = false; @@ -87,6 +89,7 @@ namespace ZR.Service.Business .OrderBy(it => it.PackageCodeClient, OrderByType.Desc) .First(); string newPatchCode = shortPatchCode; + // 最终初始编号 int lastCode = 400; // 检测包装是否已打印4XX标签 // 该工单标签最大一个 @@ -99,38 +102,46 @@ namespace ZR.Service.Business .Where(packingrecordExp) .OrderBy(it=>it.PackingCode, OrderByType.Desc) .First(); - if (lastConsolidationPackage == null && lastPackingrecord == null) + // 优先处理箱打印有历史数据情况 + if (lastPackingrecord != null) { - newPatchCode += "_401"; - } - else - { - int lastPackingrecordCode = 0; - // 优先处理箱打印有历史数据情况 - if (lastPackingrecord != null) + int subIndex = lastPackingrecord.PackingCode.Length - 5; + // XXX 此代码中 AsSpan 方法 .NET Framework 4.7.2 不支持需要更高版本 或替换为 Substring + if (int.TryParse(lastPackingrecord.PackingCode.AsSpan(subIndex).TrimStart('0'), out int lastPackingrecordCode)) { - int subIndex = lastPackingrecord.PackingCode.Length - 5; - // XXX 此代码中 AsSpan 方法 .NET Framework 4.7.2 不支持需要更高版本 或替换为 Substring - if (int.TryParse(lastPackingrecord.PackingCode.AsSpan(subIndex).TrimStart('0'), out lastPackingrecordCode)) - { - } - } - if (int.TryParse(lastConsolidationPackage.PackageCodeClient.Split('_')[1], out lastCode)) - { - // 取最大值 if (lastPackingrecordCode > lastCode) { lastCode = lastPackingrecordCode; } - if (lastCode > 400) + } + else + { + throw new Exception("生成标签数据异常:" + lastPackingrecord.PackingCode); + } + } + // 其次处理成品库历史最大数字 + if (lastConsolidationPackage != null) + { + if (int.TryParse(lastConsolidationPackage.PackageCodeClient.Split('_')[1], out int lastConsolidationPackageCode)) + { + // 取最大值 + if (lastConsolidationPackageCode > lastCode) { - newPatchCode += "_" + (lastCode + 1); - } - else - { - newPatchCode += "_401"; + lastCode = lastConsolidationPackageCode; } } + else + { + throw new Exception("生成标签数据异常:" + lastConsolidationPackage.PackageCodeClient); + } + } + if (lastCode > 400) + { + newPatchCode += "_" + (lastCode + 1); + } + else + { + newPatchCode += "_401"; } description += "\n拼箱结果:" + newPatchCode + " 总数量:" + quantityCount; DateTime nowTime = DateTime.Now.ToLocalTime(); @@ -181,6 +192,54 @@ namespace ZR.Service.Business //TODO 20240422开会讨论结果:拼箱完需要重新扫码入库,原数据删除 Context.Deleteable().Where(it => it.Id == nowProduction.Id).ExecuteCommand(); Context.Deleteable().Where(it => it.Id == secondId).ExecuteCommand(); + //TODO 20240510添加标签记录信息到标签记录信息表 + try + { + Context.Ado.BeginTran(); + WmPackageLcl mainPackageLcl = new() + { + Id = SnowFlakeSingle.instance.NextId().ToString(), + Partnumber = nowProduction.Partnumber, + PackageCode = newPatchCode, + SerialNumber = newPatchCode.Split('_')[1], + LocationCode = nowProduction.LocationCode, + GoodsNum = nowProduction.GoodsNumAction ?? 0, + Team = "C", + Type = 1, + Status = 0, + CreatedBy = "拼箱", + CreatedTime = nowTime, + Remark = "拼箱整箱" + }; + Context.Insertable(mainPackageLcl).ExecuteCommand(); + if (!isDelete) + { + WmPackageLcl oddPackageLcl = new() + { + Id = SnowFlakeSingle.instance.NextId().ToString(), + Partnumber = list[1].PartNumner, + PackageCode = list[1].PatchCode, + SerialNumber = list[1].PatchCode.Split('_')[1], + LocationCode = "LS", + GoodsNum = secondHas ?? 0, + Team = "C", + Type = 1, + Status = 0, + CreatedBy = "拼箱", + CreatedTime = nowTime, + Remark = "拼箱零头箱" + }; + Context.Insertable(oddPackageLcl).ExecuteCommand(); + } + Context.Ado.CommitTran(); + return log; + } + catch (Exception ex) + { + Context.Ado.RollbackTran(); + throw new Exception("生成打印标签信息异常!" + ex); + } + return log; // 修改主箱 Context.Updateable(nowProduction).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); @@ -246,40 +305,46 @@ namespace ZR.Service.Business .OrderBy(it => it.PackingCode, OrderByType.Desc) .First(); int lastCode = 400; - if (lastConsolidationPackage == null && lastPackingrecord == null) + // 优先处理箱打印有历史数据情况 + if (lastPackingrecord != null) { - newPatchCode1 += "_401"; - newPatchCode2 += "_402"; - } - else - { - int lastPackingrecordCode = 0; - // 优先处理箱打印有历史数据情况 - if (lastPackingrecord != null) + int subIndex = lastPackingrecord.PackingCode.Length - 5; + // XXX 此代码中 AsSpan 方法 .NET Framework 4.7.2 不支持需要更高版本 或替换为 Substring + if (int.TryParse(lastPackingrecord.PackingCode.AsSpan(subIndex).TrimStart('0'), out int lastPackingrecordCode)) { - int subIndex = lastPackingrecord.PackingCode.Length - 5; - // XXX 此代码中 AsSpan 方法 .NET Framework 4.7.2 不支持需要更高版本 或替换为 Substring - if (int.TryParse(lastPackingrecord.PackingCode.AsSpan(subIndex).TrimStart('0'), out lastPackingrecordCode)) - { - } - } - if (int.TryParse(lastConsolidationPackage.PackageCodeClient.Split('_')[1], out lastCode)) - { - if(lastPackingrecordCode > lastCode) + if (lastPackingrecordCode > lastCode) { lastCode = lastPackingrecordCode; } - if (lastCode > 400) + } + else + { + throw new Exception("生成标签数据异常:" + lastPackingrecord.PackingCode); + } + } + if(lastConsolidationPackage != null ) + { + if (int.TryParse(lastConsolidationPackage.PackageCodeClient.Split('_')[1], out int lastConsolidationPackageCode)) + { + if (lastConsolidationPackageCode > lastCode) { - newPatchCode1 += "_" + (lastCode + 1); - newPatchCode2 += "_" + (lastCode + 2); - } - else - { - newPatchCode1 += "_401"; - newPatchCode2 += "_402"; + lastCode = lastConsolidationPackageCode; } } + else + { + throw new Exception("生成标签数据异常:" + lastConsolidationPackage.PackageCodeClient); + } + } + if (lastCode > 400) + { + newPatchCode1 += "_" + (lastCode + 1); + newPatchCode2 += "_" + (lastCode + 2); + } + else + { + newPatchCode1 += "_401"; + newPatchCode2 += "_402"; } int firstNum = parm.firstNum; @@ -326,6 +391,50 @@ namespace ZR.Service.Business Context.Insertable(log).ExecuteReturnEntity(); //TODO 20240422开会讨论结果:拆箱完需要重新扫码入库,原主箱数据删除 Context.Deleteable().Where(it => it.Id == mainNowProduction.Id).ExecuteCommand(); + //TODO 20240510 添加待打印的记录 + try + { + Context.Ado.BeginTran(); + WmPackageLcl packageLcl1 = new() + { + Id = SnowFlakeSingle.instance.NextId().ToString(), + Partnumber = mainNowProduction.Partnumber, + PackageCode = jsonObject.newPatchCode1, + SerialNumber = jsonObject.serialNumber1, + LocationCode = mainNowProduction.LocationCode, + GoodsNum = jsonObject.firstNum, + Team = "C", + Type = 2, + Status = 0, + CreatedBy = "拆箱", + CreatedTime = nowTime, + Remark = "拆箱1" + }; + Context.Insertable(packageLcl1).ExecuteCommand(); + WmPackageLcl packageLcl2 = new() + { + Id = SnowFlakeSingle.instance.NextId().ToString(), + Partnumber = mainNowProduction.Partnumber, + PackageCode = jsonObject.newPatchCode2, + SerialNumber = jsonObject.serialNumber2, + LocationCode = "LS", + GoodsNum = jsonObject.secondNum ?? 0, + Team = "C", + Type = 2, + Status = 0, + CreatedBy = "拆箱", + CreatedTime = nowTime, + Remark = "拆箱2" + }; + Context.Insertable(packageLcl2).ExecuteCommand(); + Context.Ado.CommitTran(); + return log; + } + catch (Exception ex) + { + Context.Ado.RollbackTran(); + throw new Exception("生成打印标签信息异常!" + ex); + } return log; // 执行修改 // 1.主箱修改为1号分箱参数 diff --git a/ZR.Service/mes/wms/WmGoodsNowProductionService.cs b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs index 6025dde4..b11391a5 100644 --- a/ZR.Service/mes/wms/WmGoodsNowProductionService.cs +++ b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs @@ -36,6 +36,7 @@ namespace ZR.Service.mes.wms var response = Queryable() .Where(predicate.ToExpression()) + .OrderByDescending(x=>x.EntryWarehouseTime) .ToPage(parm); foreach (WmGoodsNowProductionDto item in response.Result) diff --git a/ZR.Service/mes/wms/WmOutOrderService.cs b/ZR.Service/mes/wms/WmOutOrderService.cs index 4e62dc1a..a71c1637 100644 --- a/ZR.Service/mes/wms/WmOutOrderService.cs +++ b/ZR.Service/mes/wms/WmOutOrderService.cs @@ -53,6 +53,7 @@ namespace ZR.Service.mes.wms ; var response = Queryable() .Where(predicate.ToExpression()) + .OrderByDescending(it=>it.CreatedTime) .ToPage(parm); return response; diff --git a/ZR.Service/mes/wms/WmPackageLclService.cs b/ZR.Service/mes/wms/WmPackageLclService.cs new file mode 100644 index 00000000..43a38f6a --- /dev/null +++ b/ZR.Service/mes/wms/WmPackageLclService.cs @@ -0,0 +1,114 @@ +using System; +using SqlSugar; +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.MES.wms; +using ZR.Repository; +using ZR.Service.Business.IBusinessService; +using System.Linq; +using ZR.Service.mes.wms.IService; +using ZR.Model.MES.wms.Dto; +using System.Collections.Generic; + +namespace ZR.Service.mes.wms +{ + /// + /// 拼箱/拆箱待打标签记录表Service业务层处理 + /// + [AppService(ServiceType = typeof(IWmPackageLclService), ServiceLifetime = LifeTime.Transient)] + public class WmPackageLclService : BaseService, IWmPackageLclService + { + /// + /// 查询拼箱/拆箱待打标签记录表列表 + /// + /// + /// + public PagedInfo GetList(WmPackageLclQueryDto parm) + { + var predicate = Expressionable.Create() + .AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber)) + .AndIF(!string.IsNullOrEmpty(parm.LocationCode), it => it.Partnumber.Contains(parm.LocationCode)) + .AndIF(!string.IsNullOrEmpty(parm.PackageCode), it => it.Partnumber.Contains(parm.PackageCode)) + .AndIF(parm.Status > -1, it => it.Status == parm.Status) + .AndIF(parm.Type > 0, it => it.Type == parm.Type) + ; + + var response = Queryable() + .Where(predicate.ToExpression()) + .OrderByDescending(it => it.CreatedTime) + .ToPage(parm); + if( response.Result.Count > 0) + { + foreach (WmPackageLclDto item in response.Result) + { + WmMaterial material = Context.Queryable() + .Where(it => it.Partnumber == item.Partnumber) + .First(); + if (material == null) + { + item.Description = "此零件号不在物料清单内!"; + continue; + } + item.Description = !string.IsNullOrEmpty(material.Description) ? material.Description : material.ProductName; + } + } + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public WmPackageLcl GetInfo(string Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加拼箱/拆箱待打标签记录表 + /// + /// + /// + public WmPackageLcl AddWmPackageLcl(WmPackageLcl model) + { + model.Id = SnowFlakeSingle.Instance.NextId().ToString(); + model.Remark = "手动添加"; + return Context.Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改拼箱/拆箱待打标签记录表 + /// + /// + /// + public int UpdateWmPackageLcl(WmPackageLcl model) + { + //var response = Update(w => w.Id == model.Id, it => new WmPackageLcl() + //{ + // Partnumber = model.Partnumber, + // PackageCode = model.PackageCode, + // SerialNumber = model.SerialNumber, + // LocationCode = model.LocationCode, + // GoodsNum = model.GoodsNum, + // Team = model.Team, + // Status = model.Status, + // CreatedBy = model.CreatedBy, + // CreatedTime = model.CreatedTime, + // UpdatedBy = model.UpdatedBy, + // UpdatedTime = model.UpdatedTime, + //}); + //return response; + model.Remark = "手动修改"; + return Update(model, true); + } + + } +} \ No newline at end of file