仓库-批量查询库存功能新建文件,暂未实现

This commit is contained in:
2024-04-26 11:22:33 +08:00
parent cae2643a41
commit ebc4712da0
5 changed files with 260 additions and 5 deletions

View File

@@ -0,0 +1,29 @@
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
{
/// <summary>
/// 仓库批量查询service接口
/// </summary>
public interface IWmGoodsBatchSearchService : IBaseService<WmGoodsBatchSearchDto>
{
/// <summary>
/// 树表最外层查询
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
List<WmGoodsBatchTableDto> GetBatchOutRecordByPackageCodeShort(WmGoodsBatchSearchDto parm);
/// <summary>
/// 树表子节点懒加载查询
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
List<WmGoodsBatchTableDto> GetBatchOutRecordTreeLazyByPackageCodeShort(WmGoodsBatchSearchDto parm);
}
}

View File

@@ -14,6 +14,7 @@ using System.Text.Json;
using MimeKit.Utils;
using System.Collections.Generic;
using Org.BouncyCastle.Crypto;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Service.Business
{
@@ -136,8 +137,17 @@ namespace ZR.Service.Business
var jsonObject = new
{
packageList = list,
// 拼箱批次号
newPatchCode = newPatchCode,
// 拼箱流水号
serialNumber = newPatchCode.Split("_")[1],
// 拼箱数量
newQuantityCount = quantityCount,
// 拼箱班组
Team = "C",
// 拼箱零件号
newPartnumber = mainPackage.PartNumner,
// 拼箱时间
time = DateUtils.FormatDate(nowTime)
};
// 日志记录
@@ -169,9 +179,9 @@ namespace ZR.Service.Business
nowProduction.GoodsNumAction = quantityCount;
nowProduction.Remark = "拼箱整箱";
//TODO 20240422开会讨论结果拼箱完需要重新扫码入库原数据删除
//Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == nowProduction.Id).ExecuteCommand();
//Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == secondId).ExecuteCommand();
//return log;
Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == nowProduction.Id).ExecuteCommand();
Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == secondId).ExecuteCommand();
return log;
// 修改主箱
Context.Updateable(nowProduction).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
// 次箱操作
@@ -283,11 +293,25 @@ namespace ZR.Service.Business
DateTime nowTime = DateTime.Now.ToLocalTime();
var jsonObject = new
{
// 主箱信息
mainPackage = mainPackage,
// 新标签1
newPatchCode1 = newPatchCode1,
// 新流水号1
serialNumber1 = newPatchCode1.Split("_")[1],
// 新标签2
newPatchCode2 = newPatchCode2,
// 新流水号2
serialNumber2 = newPatchCode2.Split("_")[1],
// 拆箱1数量
firstNum = firstNum,
// 拆箱2数量
secondNum = secondNum,
// 班组
Team = "C",
// 全部箱子零件号
newPartnumber = mainPackage.PartNumner,
// 拆箱时间
time = DateUtils.FormatDate(nowTime)
};
// 日志记录
@@ -301,8 +325,8 @@ namespace ZR.Service.Business
};
Context.Insertable(log).ExecuteReturnEntity();
//TODO 20240422开会讨论结果拆箱完需要重新扫码入库原主箱数据删除
//Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == mainNowProduction.Id).ExecuteCommand();
//return log;
Context.Deleteable<WmGoodsNowProduction>().Where(it => it.Id == mainNowProduction.Id).ExecuteCommand();
return log;
// 执行修改
// 1.主箱修改为1号分箱参数
WmGoodsNowProduction newPackage1 = mainNowProduction;

View File

@@ -0,0 +1,60 @@
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.Text.Json;
using MimeKit.Utils;
using System.Collections.Generic;
using Org.BouncyCastle.Crypto;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Service.Business
{
/// <summary>
/// 仓库操作日志Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IWmGoodsBatchSearchService), ServiceLifetime = LifeTime.Transient)]
public class WmGoodsBatchSearchService : BaseService<WmGoodsBatchSearchDto>, IWmGoodsBatchSearchService
{
public List<WmGoodsBatchTableDto> GetBatchOutRecordByPackageCodeShort(WmGoodsBatchSearchDto parm)
{
try
{
// 查询条件
var exp = Expressionable.Create<WmGoodsOutRecord>()
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.PackageCodeClient.Contains(parm.Partnumber))
.AndIF(!string.IsNullOrEmpty(parm.PackageCode), it => it.PackageCodeClient.Contains(parm.PackageCode))
.ToExpression();
// 出库记录
List<WmGoodsOutRecord> outPackageList = Context.Queryable<WmGoodsOutRecord>()
.Where(exp)
.GroupBy(x => x.PackageCode)
.ToList();
List<WmGoodsBatchTableDto> result = new List<WmGoodsBatchTableDto>();
return result;
}
catch
{
return null;
}
}
public List<WmGoodsBatchTableDto> GetBatchOutRecordTreeLazyByPackageCodeShort(WmGoodsBatchSearchDto parm)
{
throw new NotImplementedException();
}
}
}