| | |
| | | using System.Text; |
| | | using DocumentFormat.OpenXml.Office.CustomUI; |
| | | using Microsoft.CodeAnalysis.Operations; |
| | | using Admin.NET.Application.Service.WmsTask.WmsRbLineTask.Dto; |
| | | |
| | | namespace Admin.NET.Application; |
| | | /// <summary> |
| | |
| | | private readonly SqlSugarRepository<Mes_Package_Gather> _mesPackageGatherRep; |
| | | private readonly SqlSugarRepository<SysConfig> _sysConfigRep; |
| | | private readonly SqlSugarRepository<Mes_BatchOrderUPI_New> _mesBatchOrderUpiRep; |
| | | private readonly SqlSugarRepository<Mes_Order_Gather> _mesOrderGatherRep; |
| | | |
| | | public WmsOperationTaskService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep |
| | | , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep |
| | | , SqlSugarRepository<SysConfig> sysConfigRep |
| | | , SqlSugarRepository<Mes_BatchOrderUPI_New> mesBatchOrderUpiRep |
| | | , SqlSugarRepository<Mes_Order_Gather> mesOrderGatherRep |
| | | ) |
| | | { |
| | | _sysConfigRep = sysConfigRep; |
| | |
| | | _rep = rep; |
| | | _wmsStockQuanRep = wmsStockQuanRep; |
| | | _mesBatchOrderUpiRep = mesBatchOrderUpiRep; |
| | | _mesOrderGatherRep = mesOrderGatherRep; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | throw Oops.Oh("参数不能为空"); |
| | | } |
| | | var singlePackage = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); |
| | | if (singlePackage == null) |
| | | |
| | | var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); |
| | | if (package == null) |
| | | { |
| | | throw Oops.Oh($"没有找到包号{input.PackageCode}的汇总数据"); |
| | | } |
| | | |
| | | |
| | | |
| | | var sysConfig = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); |
| | | if (sysConfig == null) |
| | | { |
| | | throw Oops.Oh($"没有配置 判断齐套 值"); |
| | | } |
| | | if (!string.IsNullOrEmpty(sysConfig.Value) && sysConfig.Value != "无") |
| | | { |
| | | throw Oops.Oh($"判断齐套值已经存在值{sysConfig.Value},不允许操作"); |
| | | } |
| | | |
| | | var setValue = ""; |
| | | var _QiTaoReuslt = ""; |
| | | var other_orderList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == singlePackage.Info5 && x.PackageCode != input.PackageCode).ToListAsync(); |
| | | var other_orderList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == package.Info5 && x.PackageCode != input.PackageCode).ToListAsync(); |
| | | var num = other_orderList.Where(x => x.UpiStatus == UpiStatusEnum.初始 || x.UpiStatus == UpiStatusEnum.不齐包).Count(); |
| | | if (num > 0) |
| | | { |
| | |
| | | _QiTaoReuslt = "齐套"; |
| | | } |
| | | |
| | | var sysConfig = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); |
| | | if (sysConfig == null) |
| | | { |
| | | throw Oops.Oh($"没有配置 判断齐套 值"); |
| | | } |
| | | if (!string.IsNullOrEmpty(sysConfig.Value) && sysConfig.Value!="无") |
| | | { |
| | | throw Oops.Oh($"判断齐套值已经存在值{sysConfig.Value},不允许操作"); |
| | | } |
| | | |
| | | |
| | | sysConfig.Value = setValue; |
| | | await _sysConfigRep.UpdateAsync(sysConfig); |
| | | |
| | | output = singlePackage.Adapt<ValidateQiTaoOutput>(); |
| | | //记录工作时间和工作人 |
| | | |
| | | |
| | | output = package.Adapt<ValidateQiTaoOutput>(); |
| | | output.QiTaoReuslt = _QiTaoReuslt; |
| | | return output; |
| | | } |
| | |
| | | } |
| | | return singlePackage; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |