| | |
| | | private readonly SqlSugarRepository<WmsStockQuan> _wmsStockQuanRep; |
| | | private readonly SqlSugarRepository<Mes_Package_Gather> _mesPackageGatherRep; |
| | | private readonly SqlSugarRepository<SysConfig> _sysConfigRep; |
| | | private readonly SqlSugarRepository<Mes_BatchOrderUPI_New> _mesBatchOrderUpiRep; |
| | | public WmsOperationTaskService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep |
| | | , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep |
| | | , SqlSugarRepository<SysConfig> sysConfigRep |
| | | , SqlSugarRepository<Mes_BatchOrderUPI_New> mesBatchOrderUpiRep |
| | | ) |
| | | { |
| | | _sysConfigRep = sysConfigRep; |
| | | _mesPackageGatherRep = mesPackageGatherRep; |
| | | _rep = rep; |
| | | _wmsStockQuanRep = wmsStockQuanRep; |
| | | _mesBatchOrderUpiRep = mesBatchOrderUpiRep; |
| | | } |
| | | |
| | | |
| | |
| | | output.QiTaoReuslt = _QiTaoReuslt; |
| | | return output; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¸å¯¹æ ç¾ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [ApiDescriptionSettings(Name = "ValdateLabel")] |
| | | [Description("WmsOperationTask/ValdateLabel")] |
| | | public async Task<Mes_Package_Gather> ValdateLabel(ValidateLabelInput input) |
| | | { |
| | | if (input == null || input.PackageCode == null || input.Upi == null) |
| | | { |
| | | throw Oops.Oh("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.Upi).FirstAsync(); |
| | | if (singleUpi == null) |
| | | { |
| | | throw Oops.Oh($"æ²¡ææ¾å°é¨ä»¶æ¡ç {input.Upi}çæ°æ®"); |
| | | } |
| | | if (singleUpi.PackageCode != input.PackageCode) |
| | | { |
| | | throw Oops.Oh($"é¨ä»¶æ¡ç {input.Upi}æå±å
æ¯{singleUpi.PackageCode},è·æ«æçå
å·{input.PackageCode}ä¸ç¬¦"); |
| | | } |
| | | |
| | | var singlePackage = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); |
| | | if (singlePackage == null) |
| | | { |
| | | throw Oops.Oh($"æ²¡ææ¾å°å
å·{input.PackageCode}çæ±æ»æ°æ®"); |
| | | } |
| | | return singlePackage; |
| | | } |
| | | } |
| | | |