执行代码清理,修复warning
This commit is contained in:
@@ -39,31 +39,33 @@ namespace Tnb.ProductionMgr
|
||||
("25546256076325","25530834099477"),
|
||||
};
|
||||
List<MoldsEntity> list = new();
|
||||
var index = 1;
|
||||
foreach (var item in multi)
|
||||
int index = 1;
|
||||
foreach ((string pId, string eqpId) in multi)
|
||||
{
|
||||
MoldsEntity entity = new();
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
entity.MoldCode = $"m00{index}";
|
||||
entity.MoldName = "磨具" + index;
|
||||
entity.ItemId = item.pId;
|
||||
entity.EqpId = item.eqpId;
|
||||
MoldsEntity entity = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
MoldCode = $"m00{index}",
|
||||
MoldName = "磨具" + index,
|
||||
ItemId = pId,
|
||||
EqpId = eqpId
|
||||
};
|
||||
list.Add(entity);
|
||||
index++;
|
||||
}
|
||||
var link = await _repository.GetFirstAsync(x => x.FullName == "tnb_eqp");
|
||||
var db = _dataBaseManager.ChangeDataBase(link);
|
||||
var row = await db.Insertable(list).ExecuteCommandAsync();
|
||||
DbLinkEntity link = await _repository.GetFirstAsync(x => x.FullName == "tnb_eqp");
|
||||
SqlSugarScope db = _dataBaseManager.ChangeDataBase(link);
|
||||
int row = await db.Insertable(list).ExecuteCommandAsync();
|
||||
if (row > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
foreach (MoldsEntity item in list)
|
||||
{
|
||||
var dic = new Dictionary<string, object>
|
||||
Dictionary<string, object> dic = new()
|
||||
{
|
||||
{"id",item.EqpId },
|
||||
{ "mold_id", item.id}
|
||||
};
|
||||
var row2 = await db.Updateable(dic).AS("eqp_equipment")
|
||||
int row2 = await db.Updateable(dic).AS("eqp_equipment")
|
||||
.WhereColumns("id").
|
||||
ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user