| | |
| | | .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo) |
| | | .LeftJoin<SysUserInfor>((tb1, tb2,tb3) => tb1.CreateUser == tb3.Id) |
| | | .LeftJoin<SysUserInfor>((tb1,tb2,tb3,tb4) => tb1.UpdateUser == tb4.Id) |
| | | .LeftJoin<SysMaterials>((tb1, tb2, tb3, tb4,tb5) => tb1.SkuNo == tb5.SkuNo) |
| | | .LeftJoin<SysMaterials>((tb1, tb2, tb3, tb4,tb5) => tb1.SkuNo == tb5.SkuNo && tb5.IsDel == "0") |
| | | .LeftJoin<SysUnit>((tb1, tb2, tb3, tb4, tb5,tb6) => tb5.UnitNo == tb6.UnitNo) |
| | | .LeftJoin<SysPackag>((tb1, tb2, tb3, tb4, tb5, tb6,tb7) => tb1.PackagNo == tb7.PackagNo) |
| | | .Select((tb1, tb2, tb3, tb4, tb5,tb6, tb7) => new ArrivalNoticeDetailDto() |
| | |
| | | string toDayTime = dateTime.ToString("yyyymmdd"); |
| | | List<BllArrivalNoticeDetail> addDetails = new List<BllArrivalNoticeDetail>(); |
| | | List<BllArrivalNoticeDetail> editDetails = new List<BllArrivalNoticeDetail>(); |
| | | var maxLotNo = ""; |
| | | foreach (ArrivalNoticeDetailVm detailModel in detailModels) |
| | | { |
| | | if (string.IsNullOrEmpty(detailModel.SkuNo)) |
| | |
| | | if (detailModel.Id == 0 || detailModel.Id == null || string.IsNullOrWhiteSpace(detailModel.LotNo)) |
| | | { |
| | | var notice = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && TypeLot.Contains(m.Type)).Select(m => m.ASNNo).ToList(); |
| | | var maxLotNo = Db.Queryable<BllArrivalNoticeDetail>().Where(m=>m.IsDel == "0" && !string.IsNullOrWhiteSpace(m.LotNo) && notice.Contains(m.ASNNo)).Max(m=>m.LotNo); |
| | | if (string.IsNullOrWhiteSpace(maxLotNo)) |
| | | { |
| | | maxLotNo = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && !string.IsNullOrWhiteSpace(m.LotNo) && notice.Contains(m.ASNNo)).Max(m => m.LotNo); |
| | | } |
| | | if (string.IsNullOrWhiteSpace(maxLotNo)) |
| | | { |
| | | maxLotNo = toDayTime.Substring(2, 6) + "0001"; |