PDA-库存查询功能更新
This commit is contained in:
parent
263f30822e
commit
f88c6826c1
@ -57,10 +57,15 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("shortPatchsearch")]
|
||||
public IActionResult QueryshortPatch(WmGoodsNowProductionQueryDto parm)
|
||||
public IActionResult QueryshortPatch(CommonQueryDto parm)
|
||||
{
|
||||
var response = _WmGoodsNowProductionService.QueryshortPatch(parm);
|
||||
return SUCCESS(response);
|
||||
List<WmGoodShortPackageCodeDto> response = _WmGoodsNowProductionService.QueryshortPatch(parm);
|
||||
var json = new
|
||||
{
|
||||
list = response,
|
||||
total = response.Count
|
||||
};
|
||||
return ToResponse(new ApiResult(200, "ok", json));
|
||||
}
|
||||
/// <summary>
|
||||
/// 移动端 短批次号查询
|
||||
@ -84,7 +89,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
public IActionResult GetWmGoodsNowProduction(string Id)
|
||||
{
|
||||
var response = _WmGoodsNowProductionService.GetInfo(Id);
|
||||
|
||||
|
||||
var info = response.Adapt<WmGoodsNowProduction>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
@ -144,14 +149,14 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
/// <param name="stack_num"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("modifyInventoryQuantity")]
|
||||
public IActionResult ModifyInventoryQuantity(string id,int stack_num)
|
||||
public IActionResult ModifyInventoryQuantity(string id, int stack_num)
|
||||
{
|
||||
if(string.IsNullOrEmpty(id))
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response= _WmGoodsNowProductionService.ModifyInventoryQuantity(id, stack_num);
|
||||
return SUCCESS(response);
|
||||
var response = _WmGoodsNowProductionService.ModifyInventoryQuantity(id, stack_num);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生成出货单的出货计划
|
||||
/// 8.1根据出库单生成出库计划
|
||||
/// </summary>
|
||||
/// <param name="shipment_num"></param>
|
||||
/// <returns></returns>
|
||||
@ -167,28 +167,57 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
return SUCCESS(null);
|
||||
}
|
||||
// TODO 1.返回值修改为 对象 返回是否可生成计划,计划结果:{canPlan:true,resultList:[]}
|
||||
// XXX 无计划返回空即可
|
||||
List<WmOutOrderPlan> WmOutOrderPlanList = _WmOutOrderService.Generate_outorderplan(shipment_num);
|
||||
|
||||
return SUCCESS(WmOutOrderPlanList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 持久化存储出货单的出货计划
|
||||
/// 8.2 持久化存储出库单的出库计划
|
||||
/// </summary>
|
||||
/// <param name="shipment_num"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("persistenceOutorderplan")]
|
||||
public IActionResult PersistenceOutorderplan(string shipment_num)
|
||||
{
|
||||
|
||||
if (shipment_num == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
int result= _WmOutOrderService.PersistenceOutorderplan(shipment_num);
|
||||
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 8.3 获取出库单的持久化存储出库计划
|
||||
/// </summary>
|
||||
/// <param name="shipment_num"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getOutOrderplan")]
|
||||
public IActionResult getOutOrderplan(string shipment_num)
|
||||
{
|
||||
if (shipment_num == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
int result = _WmOutOrderService.PersistenceOutorderplan(shipment_num);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 8.4 获取出库单的已出货物
|
||||
/// </summary>
|
||||
/// <param name="shipment_num"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getOutOrderOutProduction")]
|
||||
public IActionResult getOutOrderOutProduction(string shipment_num)
|
||||
{
|
||||
if (shipment_num == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
int result = _WmOutOrderService.PersistenceOutorderplan(shipment_num);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -2,6 +2,13 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.MES.wms.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用查询条件
|
||||
/// </summary>
|
||||
public class CommonQueryDto : PagerInfo
|
||||
{
|
||||
public string Query { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 拼箱操作
|
||||
/// </summary>
|
||||
|
||||
@ -75,8 +75,6 @@ namespace ZR.Model.MES.wms.Dto
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -55,4 +55,31 @@ namespace ZR.Model.MES.wms.Dto
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 成品库短批次号集合显示
|
||||
/// </summary>
|
||||
public class WmGoodShortPackageCodeDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 短批次号
|
||||
/// </summary>
|
||||
public string ShortPackageCode { get; set; }
|
||||
/// <summary>
|
||||
/// 短批次总箱数
|
||||
/// </summary>
|
||||
public int PackageNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 短批次总零件数
|
||||
/// </summary>
|
||||
public int? PartnumberNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 短批次零件号
|
||||
/// </summary>
|
||||
public string Partnumber { get; set; }
|
||||
/// <summary>
|
||||
/// 短批次系统入库时间
|
||||
/// </summary>
|
||||
public DateTime? EntryWarehouseTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,14 +23,14 @@ namespace ZR.Service.mes.wms.IService
|
||||
(List<WmGoods_nodeDto>, int) QuerypatchsearchList(WmGoodsNowProductionQueryDto parm);
|
||||
|
||||
/// <summary>
|
||||
/// 短批次查询
|
||||
/// 移动端 短批次查询
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
List<WmGoods_nodeDto> QueryshortPatch(WmGoodsNowProductionQueryDto parm);
|
||||
List<WmGoodShortPackageCodeDto> QueryshortPatch(CommonQueryDto parm);
|
||||
|
||||
/// <summary>
|
||||
/// 移动端 查询短批次号 细则
|
||||
/// 移动端 查询短批次号 细则详情
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@ -11,6 +11,7 @@ using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using System.Collections.Generic;
|
||||
using Mapster;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
@ -36,7 +37,7 @@ namespace ZR.Service.mes.wms
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmGoodsNowProduction, WmGoodsNowProductionDto>(parm);
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -98,21 +99,53 @@ namespace ZR.Service.mes.wms
|
||||
return (list, total);
|
||||
}
|
||||
/// <summary>
|
||||
/// 移动端 短批次号查询
|
||||
/// 移动端 货物查看 根据Query零件号与批次号查看信息
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public List<WmGoods_nodeDto> QueryshortPatch(WmGoodsNowProductionQueryDto parm)
|
||||
public List<WmGoodShortPackageCodeDto> QueryshortPatch(CommonQueryDto parm)
|
||||
{
|
||||
|
||||
List<WmGoods_nodeDto> list = null;
|
||||
int total = 0;
|
||||
// 结果集
|
||||
List<WmGoodShortPackageCodeDto> resultList = new();
|
||||
// 全数据处理
|
||||
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));
|
||||
.OrIF(!string.IsNullOrEmpty(parm.Query), it => it.Partnumber.Contains(parm.Query))
|
||||
.OrIF(!string.IsNullOrEmpty(parm.Query), it => it.PackageCodeClient.Contains(parm.Query));
|
||||
List<WmGoodsNowProduction> wmGoodsNowsList = Context.Queryable<WmGoodsNowProduction>()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderByDescending(it => it.PackageCodeClient)
|
||||
.ToList();
|
||||
|
||||
// 聚合数据
|
||||
resultList = wmGoodsNowsList.GroupBy(it => it.PackageCodeClient.Split('_')[0])
|
||||
.Select(group => new WmGoodShortPackageCodeDto
|
||||
{
|
||||
ShortPackageCode = group.Key,
|
||||
Partnumber = group.Max(item => item.Partnumber),
|
||||
EntryWarehouseTime = group.Max(item => item.EntryWarehouseTime),
|
||||
PackageNumber = group.Count(),
|
||||
PartnumberNumber = group.Sum(item=>item.GoodsNumAction)
|
||||
}).ToList();
|
||||
// 结果数据处理
|
||||
//每页多少条
|
||||
int rows = parm.PageSize;
|
||||
//第几页
|
||||
int page = parm.PageNum;
|
||||
//每一页开始下标
|
||||
int startIndex = (page - 1) * rows;
|
||||
//数据总数
|
||||
int sum = resultList.Count;
|
||||
|
||||
List<WmGoodsNowProduction> rawdatas = Queryable().Where(predicate.ToExpression()).ToList();
|
||||
if (rawdatas != null && rawdatas.Count > 0)
|
||||
if (startIndex + rows > sum)
|
||||
{
|
||||
resultList = resultList.Skip(startIndex).Take(sum).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
resultList = resultList.Skip(startIndex).Take(startIndex + rows).ToList();
|
||||
}
|
||||
return resultList;
|
||||
/*if (rawdatas != null && rawdatas.Count > 0)
|
||||
{
|
||||
//todo 对字段进行拆分
|
||||
|
||||
@ -149,25 +182,32 @@ namespace ZR.Service.mes.wms
|
||||
return WmGoods_nodeDto_list_parent.OrderByDescending(it => it.PackageCodeClient_son).ToList();
|
||||
|
||||
}
|
||||
return null;
|
||||
return null;*/
|
||||
}
|
||||
/// <summary>
|
||||
/// 移动端 短批次号详情
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public List<WmGoodsNowProductionDto> Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
|
||||
public List<WmGoodsNowProductionDto> Patchsearchdetail(WmGoodsNowProductionQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmGoodsNowProduction>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.PackageCodeClient), it => it.PackageCodeClient.Contains(parm.PackageCodeClient));
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(it=>it.PackageCodeClient)
|
||||
.OrderBy(it => it.PackageCodeClient)
|
||||
.Select(it => new WmGoodsNowProductionDto
|
||||
{
|
||||
PackageCodeClient = it.PackageCodeClient,
|
||||
LocationCode = it.LocationCode,
|
||||
Partnumber = it.Partnumber,
|
||||
GoodsNumAction = it.GoodsNumAction,
|
||||
EntryWarehouseTime = it.EntryWarehouseTime,
|
||||
Remark = (!string.IsNullOrEmpty(it.Remark)? it.Remark:"无备注"),
|
||||
})
|
||||
.ToList();
|
||||
|
||||
|
||||
return response.Adapt<List<WmGoodsNowProductionDto>>();
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
@ -197,9 +237,9 @@ namespace ZR.Service.mes.wms
|
||||
{
|
||||
model.Id = SnowFlakeSingle.Instance.NextId().ToString();//也可以在程序中直接获取ID
|
||||
}
|
||||
if(string.IsNullOrEmpty(model.PackageCode))
|
||||
if (string.IsNullOrEmpty(model.PackageCode))
|
||||
{
|
||||
model.PackageCode=model.PackageCodeClient;
|
||||
model.PackageCode = model.PackageCodeClient;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.PackageCodeOriginal))
|
||||
{
|
||||
@ -241,11 +281,11 @@ namespace ZR.Service.mes.wms
|
||||
/// <param name="id"></param>
|
||||
/// <param name="stack_num"></param>
|
||||
/// <returns></returns>
|
||||
public int ModifyInventoryQuantity(string id, int stack_num)
|
||||
public int ModifyInventoryQuantity(string id, int stack_num)
|
||||
{
|
||||
return Context.Updateable<WmGoodsNowProduction>()
|
||||
.SetColumns(it => it.GoodsNumAction == stack_num)
|
||||
.Where(it => it.Id == id).ExecuteCommand();
|
||||
return Context.Updateable<WmGoodsNowProduction>()
|
||||
.SetColumns(it => it.GoodsNumAction == stack_num)
|
||||
.Where(it => it.Id == id).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user