| | |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | |
| | | // 获取单据列表 |
| | | public List<ArrivalNoticeDto> GetArrivalNotices(ArrivalNoticeVm model) |
| | | public List<string> GetArrivalNotices(ArrivalNoticeVm model) |
| | | { |
| | | string sqlString = string.Empty; |
| | | try |
| | | { |
| | | // 未关单的单据 |
| | | sqlString = $"select * from BllArrivalNotice where Type in ({model.Type}) and Status != '3' and Status != '4' and IsDel='0' order by CreateTime;"; |
| | | var modelList = Db.Ado.SqlQuery<ArrivalNoticeDto>(sqlString); |
| | | //sqlString = $"select * from BllArrivalNotice where Type in ({model.Type}) and Status != '3' and Status != '4' and IsDel='0' order by CreateTime;"; |
| | | //var modelList = Db.Ado.SqlQuery<ArrivalNoticeDto>(sqlString); |
| | | |
| | | return modelList; |
| | | //model.Type:单据类型 在这里代表前端页签类型:即标签页签:贴标物料; 数量页签:不贴表物料,原因:懒得加参数 |
| | | var data = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && m.Status != "3" && m.Status != "4").Select(m=>m.ASNNo).ToList(); |
| | | var list = new List<string>(); |
| | | if (model.Type == "0")//0贴标 |
| | | { |
| | | list = Db.Queryable<BllArrivalNoticeDetail>().Where(m =>m.IsDel == "0" && data.Contains(m.ASNNo) && !string.IsNullOrWhiteSpace(m.PackagNo)).Select(m => m.ASNNo).Distinct().ToList(); |
| | | } |
| | | else if(model.Type == "1")//1不贴标 |
| | | { |
| | | list = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && data.Contains(m.ASNNo) && string.IsNullOrWhiteSpace(m.PackagNo)).Select(m=>m.ASNNo).Distinct().ToList(); |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("页签类型参数错误"); |
| | | } |
| | | |
| | | |
| | | return list; |
| | | } |
| | | catch (Exception ex) |
| | | { |