wms:批量货物查看
This commit is contained in:
@@ -40,6 +40,19 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量查询 父子节点
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("patchsearch")]
|
||||
public IActionResult Querypatchsearch(WmGoodsNowProductionQueryDto parm)
|
||||
{
|
||||
var response = _WmGoodsNowProductionService.QuerypatchsearchList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询成品库当前货物表详情
|
||||
/// </summary>
|
||||
|
||||
58
ZR.Model/MES/wms/Dto/WmGoods_nodeDto.cs
Normal file
58
ZR.Model/MES/wms/Dto/WmGoods_nodeDto.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.wms.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 当前仓库货物节点表
|
||||
/// </summary>
|
||||
public class WmGoods_nodeDto
|
||||
{
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
|
||||
public string PackageCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父节点 就是短批次号
|
||||
/// </summary>
|
||||
public string PackageCodeClient_short_parent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点 (主键)
|
||||
/// </summary>
|
||||
public string PackageCodeClient_son { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱数
|
||||
/// </summary>
|
||||
public int Pack_num { get; set; }
|
||||
|
||||
public string PackageCodeOriginal { get; set; }
|
||||
|
||||
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
public string Partnumber { get; set; }
|
||||
|
||||
public int? GoodsNumLogic { get; set; }
|
||||
|
||||
public int? GoodsNumAction { get; set; }
|
||||
|
||||
public DateTime? EntryWarehouseTime { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using ZR.Model.Dto;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using Aliyun.OSS;
|
||||
|
||||
namespace ZR.Service.mes.wms.IService
|
||||
{
|
||||
@@ -14,6 +15,12 @@ namespace ZR.Service.mes.wms.IService
|
||||
public interface IWmGoodsNowProductionService : IBaseService<WmGoodsNowProduction>
|
||||
{
|
||||
PagedInfo<WmGoodsNowProductionDto> GetList(WmGoodsNowProductionQueryDto parm);
|
||||
/// <summary>
|
||||
/// 批量查看
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
(List<WmGoods_nodeDto>, int) QuerypatchsearchList(WmGoodsNowProductionQueryDto parm);
|
||||
|
||||
WmGoodsNowProduction GetInfo(string Id);
|
||||
|
||||
|
||||
@@ -184,11 +184,7 @@ namespace ZR.Service.Business
|
||||
Context.Updateable<AgvTask>().SetColumns(it => it.BackTaskId == res_data.reqCode)
|
||||
.Where(it => it.Id == agvTask.Id).ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
@@ -39,6 +40,64 @@ namespace ZR.Service.mes.wms
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量查看
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public (List<WmGoods_nodeDto>,int) QuerypatchsearchList(WmGoodsNowProductionQueryDto parm)
|
||||
{
|
||||
List<WmGoods_nodeDto> list = null;
|
||||
int total = 0;
|
||||
var predicate = Expressionable.Create<WmGoodsNowProduction>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.PackageCodeClient), it => it.PackageCodeClient.Contains(parm.PackageCodeClient));
|
||||
|
||||
List<WmGoodsNowProduction> rawdatas = Queryable().Where(predicate.ToExpression()).ToPageList(parm.PageNum, parm.PageSize, ref total);
|
||||
if(rawdatas!=null&&rawdatas.Count > 0)
|
||||
{
|
||||
//todo 对字段进行拆分
|
||||
|
||||
List<WmGoods_nodeDto> WmGoods_nodeDto_list= rawdatas.Select(p => new WmGoods_nodeDto() {
|
||||
Id =p.Id,
|
||||
PackageCode =p.PackageCode,
|
||||
PackageCodeClient_short_parent = p.PackageCodeClient.Split("_")[0],
|
||||
PackageCodeClient_son=p.PackageCodeClient,
|
||||
PackageCodeOriginal=p.PackageCodeClient,
|
||||
LocationCode = p.LocationCode,
|
||||
Partnumber = p.Partnumber,
|
||||
GoodsNumLogic=p.GoodsNumLogic,
|
||||
GoodsNumAction=p.GoodsNumAction,
|
||||
EntryWarehouseTime=p.EntryWarehouseTime,
|
||||
Remark= p.Remark,
|
||||
|
||||
}).ToList();
|
||||
//todo 分组 聚合 生成父节点
|
||||
|
||||
List<WmGoods_nodeDto> WmGoods_nodeDto_list_parent = WmGoods_nodeDto_list.GroupBy(p => p.PackageCodeClient_short_parent)
|
||||
.Select(group => new WmGoods_nodeDto()
|
||||
{
|
||||
PackageCodeClient_short_parent = "",
|
||||
PackageCodeClient_son = group.Key,
|
||||
GoodsNumLogic = group.Sum(group => group.GoodsNumLogic),
|
||||
GoodsNumAction = group.Sum(group => group.GoodsNumAction),
|
||||
Partnumber = group.Max(group => group.Partnumber),
|
||||
Pack_num = group.Count()
|
||||
}).ToList();
|
||||
|
||||
//todo 合并
|
||||
|
||||
list = WmGoods_nodeDto_list.Concat(WmGoods_nodeDto_list_parent).ToList();
|
||||
|
||||
|
||||
}
|
||||
return (list,total);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
@@ -94,5 +153,6 @@ namespace ZR.Service.mes.wms
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user