生产管理模块代码调整

This commit is contained in:
DEVICE8\12494
2023-05-12 22:58:16 +08:00
parent 85e7338669
commit 77bb079eee
31 changed files with 2315 additions and 1412 deletions

View File

@@ -455,17 +455,17 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
var eqpList = (jsonObj.Value<JArray>("roweqp"));
var eqpIds = eqpList.Select(x => x.Value<string>("id")).ToList();
isOK = await _repository.AsSugarClient().Updateable<EqpEquipment>().SetColumns(it => new EqpEquipment { station_code = input.enCode }).Where(it => eqpIds.Contains(it.id)).ExecuteCommandAsync();
//工位与设备解绑操作
var eqpEntities = await _repository.AsSugarClient().Queryable<EqpEquipment>().Where(it => it.station_code == input.enCode).ToListAsync();
if (eqpEntities?.Count > 0)
{
var unbindEqpIds = eqpEntities.Select(x => x.id).Except(eqpIds).ToList();
if (unbindEqpIds?.Count > 0)
{
isOK = await _repository.AsSugarClient().Updateable<EqpEquipment>().SetColumns(it => new EqpEquipment { station_code = "" }).Where(it => unbindEqpIds.Contains(it.id)).ExecuteCommandAsync();
}
}
//isOK = await _repository.AsSugarClient().Updateable<EqpEquipment>().SetColumns(it => new EqpEquipment { station_code = input.enCode }).Where(it => eqpIds.Contains(it.id)).ExecuteCommandAsync();
////工位与设备解绑操作
//var eqpEntities = await _repository.AsSugarClient().Queryable<EqpEquipment>().Where(it => it.station_code == input.enCode).ToListAsync();
//if (eqpEntities?.Count > 0)
//{
// var unbindEqpIds = eqpEntities.Select(x => x.id).Except(eqpIds).ToList();
// if (unbindEqpIds?.Count > 0)
// {
// isOK = await _repository.AsSugarClient().Updateable<EqpEquipment>().SetColumns(it => new EqpEquipment { station_code = "" }).Where(it => unbindEqpIds.Contains(it.id)).ExecuteCommandAsync();
// }
//}
}
var processVal = jsonObj.GetValue("rowprocess");
if (processVal is not null)