| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData |
| | | { |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesRohInManager : Repository<MesRohIn> |
| | | { |
| | | private readonly MesRohInDataManager rohInDataManager = new(); |
| | |
| | | { |
| | | var decimals = mesRohInDatas.Select(s => s.Id).ToArray(); |
| | | |
| | | if (mesRohIn.Id != null) |
| | | { |
| | | base.DeleteById(mesRohIn.Id); |
| | | } |
| | | if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id); |
| | | |
| | | if (decimals.Length > 0) |
| | | { |
| | | db.Deleteable<MesRohInData>().In(decimals).ExecuteCommand(); |
| | | } |
| | | |
| | | var insert = base.Insert(mesRohIn); |
| | | var insertRange = |
| | |
| | | private bool SaveOrUpdateData(SqlSugarScope db, MesRohIn mesRohIn, |
| | | List<MesRohInData> mesRohInDatas) |
| | | { |
| | | |
| | | if (mesRohIn.Id != null) |
| | | { |
| | | base.DeleteById(mesRohIn.Id); |
| | | } |
| | | if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id); |
| | | |
| | | if (mesRohInDatas.Count > 0) |
| | | { |
| | | db.Deleteable<MesRohInData>().Where(s=>s.ErpId == mesRohIn.EbelnK3id).ExecuteCommand(); |
| | | } |
| | | db.Deleteable<MesRohInData>() |
| | | .Where(s => s.ErpId == mesRohIn.EbelnK3id).ExecuteCommand(); |
| | | |
| | | var orUpdate = base.Insert(mesRohIn); |
| | | var baOrUpdate = rohInDataManager.InsertRange(mesRohInDatas); |
| | |
| | | |
| | | return entity; |
| | | }).ToList(); |
| | | } |
| | | } |
| | | } |