| | |
| | | |
| | | namespace iWareDataCore.BASE.Service |
| | | { |
| | | public class InOutListService : CommonService<InOutListEntity, BASEInOutList, DbModelCore> |
| | | public class InOutListService : CommonService<InOutListEntity, BASEInOutList, DbModelCore> |
| | | { |
| | | private static object Lock = new object(); |
| | | |
| | |
| | | { |
| | | List<BASEInOutListDetail> inldlst = new List<BASEInOutListDetail>(); |
| | | msg = ""; |
| | | |
| | | //验证单号是否已经存在 【Editby shaocx,2025-09-17】 |
| | | var findInOutList = DbModel.BASEInOutLists.FirstOrDefault(x => x.listno == iol.ListNo); |
| | | if (findInOutList != null) |
| | | { |
| | | msg = $"单号{iol.ListNo}已存在"; |
| | | return -1; |
| | | } |
| | | |
| | | iol.InOutListDetail.ForEach(x => { inldlst.Add(x.ToOrm()); }); |
| | | BASEInOutList biol = new BASEInOutList(); |
| | | biol = iol.ToOrm(); |
| | |
| | | msg = ""; |
| | | using (var dbModel = new DbModelCore()) |
| | | { |
| | | var cutInOut = dbModel.BASEInOutLists.FirstOrDefault(x=>x.listno== inoutNo); |
| | | var cutInOut = dbModel.BASEInOutLists.FirstOrDefault(x => x.listno == inoutNo); |
| | | if (cutInOut == null) |
| | | { |
| | | msg = "出入库单号不存在"; |
| | |
| | | msg = "物料不存在"; |
| | | return false; |
| | | } |
| | | var findInOutDetail = dbModel.BASEInOutListDetails.FirstOrDefault(x => x.inoutlistid == cutInOut.id && x.materialid== cutMarital.id); |
| | | var findInOutDetail = dbModel.BASEInOutListDetails.FirstOrDefault(x => x.inoutlistid == cutInOut.id && x.materialid == cutMarital.id); |
| | | if (findInOutDetail != null) |
| | | { |
| | | msg = "此单号和物料已存在"; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | public override int Delete(int id, out string msg) |
| | | { |
| | | msg = ""; |