| | |
| | | |
| | | private MesUnit GetMesUnit(ErpUnit unit) |
| | | { |
| | | |
| | | var fForbidStatus = unit.FForbidStatus; |
| | | if (unit.FForbidStatus == "0") |
| | | { |
| | |
| | | fForbidStatus = "B"; |
| | | } |
| | | |
| | | return new MesUnit |
| | | var entity = new MesUnit |
| | | { |
| | | Id = string.IsNullOrEmpty(unit.Id) |
| | | ? DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| | |
| | | Factory = "1000", |
| | | Type = unit.Type |
| | | }; |
| | | |
| | | var mesUnit = Db.Queryable<MesUnit>() |
| | | .Where(s => s.Fnumber == entity.Fnumber) |
| | | .First(); |
| | | |
| | | if (mesUnit != null) |
| | | { |
| | | entity.Id = mesUnit.Id; |
| | | } |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | private bool UpdateUnitStatusBatch(SqlSugarScope db, List<MesUnit> unitList, |