| | |
| | | using Model.InterFaceModel; |
| | | using Model.ModelDto; |
| | | using Model.ModelDto.BllAsnDto; |
| | | using Model.ModelDto.SysDto; |
| | | using Model.ModelVm; |
| | | using Model.ModelVm.SysVm; |
| | |
| | | } |
| | | |
| | | //获取入库单明细剩余打印数量 |
| | | public string GetAsnDetailQtyList(int id) |
| | | public LabelPrintInfoDto GetAsnDetailQtyList(int id) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | throw new Exception("未查询到入库单明细"); |
| | | } |
| | | var data = new LabelPrintInfoDto(); |
| | | |
| | | data.ProductionTime = string.IsNullOrEmpty(detail.Lot1) ? "" : Convert.ToDateTime(detail.Lot1).ToString("yyyy-MM-dd"); |
| | | data.ExpirationTime = string.IsNullOrEmpty(detail.Lot2) ? "" : Convert.ToDateTime(detail.Lot2).ToString("yyyy-MM-dd"); |
| | | data.SupplierLot = detail.SupplierLot; |
| | | var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty + (m.SamplingQty == null? 0: m.SamplingQty)); |
| | | if (labelQty == null) |
| | | { |
| | |
| | | { |
| | | qty = 0; |
| | | } |
| | | return qty.ToString(); |
| | | data.Qty = qty.ToString(); |
| | | return data; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | string lot1 = detailModel.Lot1; |
| | | string lot2 = detailModel.Lot2; |
| | | if (sku.IsPasteCode == "0") |
| | | if (sku.IsInspect == "0")//是否免检,0:否 1:是 |
| | | { |
| | | //不贴标物料 生产日期、有效期不能为空 |
| | | //不免检物料 生产日期、有效期不能为空 |
| | | DateTime lot12; |
| | | DateTime lot22; |
| | | if (!DateTime.TryParse(detailModel.Lot1, out lot12)) |
| | | { |
| | | throw new Exception("非贴标物料生产日期转换失败"); |
| | | throw new Exception("不免检物料生产日期转换失败"); |
| | | } |
| | | if (!DateTime.TryParse(detailModel.Lot2, out lot22)) |
| | | { |
| | | throw new Exception("非贴标物料过期日期转换失败"); |
| | | throw new Exception("不免检物料过期日期转换失败"); |
| | | } |
| | | lot1 = lot12.ToString(); |
| | | lot2 = lot22.ToString(); |
| | |
| | | && it.IsBelt == detailModel.IsBelt |
| | | && it.Lot1 == detailModel.Lot1 // 生产日期 |
| | | && it.Lot2 == detailModel.Lot2 // 过期日期 |
| | | && it.BoxCodeStr == detailModel.BoxCodeStr |
| | | && it.UDF1 == detailModel.UDF1 |
| | | && it.UDF2 == detailModel.UDF2 |
| | | && it.UDF3 == detailModel.UDF3 |
| | |
| | | dbDetail.IsBale = detailModel.IsBale; |
| | | dbDetail.Lot1 = detailModel.Lot1; |
| | | dbDetail.Lot2 = detailModel.Lot2; |
| | | dbDetail.BoxCodeStr = detailModel.BoxCodeStr; |
| | | dbDetail.UDF1 = detailModel.UDF1; |
| | | dbDetail.UDF2 = detailModel.UDF2; |
| | | dbDetail.UDF3 = detailModel.UDF3; |