执行代码清理,修复warning
This commit is contained in:
@@ -51,10 +51,10 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> OutApply(RepairOutApplyInput input)
|
||||
{
|
||||
EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable<EqpRepairApply>().SingleAsync(x => x.id == input.repair_apply_id);
|
||||
if (eqpRepairApply.status == RepairApplyStatus.TOBEOUTAPPLY ||
|
||||
eqpRepairApply.status == RepairApplyStatus.APPROVENOTPASS)
|
||||
if (eqpRepairApply.status is RepairApplyStatus.TOBEOUTAPPLY or
|
||||
RepairApplyStatus.APPROVENOTPASS)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
string id = string.IsNullOrEmpty(input.id) ? SnowflakeIdHelper.NextId() : input.id;
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace Tnb.EquipMgr
|
||||
// },x=>x.id==input.id);
|
||||
}
|
||||
|
||||
await db.Updateable<EqpRepairApply>()
|
||||
_ = await db.Updateable<EqpRepairApply>()
|
||||
.SetColumns(x => x.status == RepairApplyStatus.OUTAPPLYAPPROVE)
|
||||
.Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync();
|
||||
|
||||
@@ -100,7 +100,10 @@ namespace Tnb.EquipMgr
|
||||
|
||||
});
|
||||
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
throw Oops.Oh(ErrorCode.COM1008);
|
||||
}
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
@@ -129,7 +132,7 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _repository.GetSingleAsync(x => x.id == input.id);
|
||||
EqpRepairOutApply entity = await _repository.GetSingleAsync(x => x.id == input.id);
|
||||
if (entity != null)
|
||||
{
|
||||
|
||||
@@ -170,10 +173,10 @@ namespace Tnb.EquipMgr
|
||||
public async Task<string> Register(RepairApplyOutRegisterInput input)
|
||||
{
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpRepairOutApply()
|
||||
_ = await _repository.UpdateAsync(x => new EqpRepairOutApply()
|
||||
{
|
||||
real_supplier_id = input.real_supplier_id,
|
||||
cost = input.cost,
|
||||
@@ -183,12 +186,10 @@ namespace Tnb.EquipMgr
|
||||
attachment = input.attachment,
|
||||
}, x => x.id == input.id);
|
||||
|
||||
await db.Updateable<EqpRepairApply>().SetColumns(x => x.status == RepairApplyStatus.COMPLETED)
|
||||
_ = await db.Updateable<EqpRepairApply>().SetColumns(x => x.status == RepairApplyStatus.COMPLETED)
|
||||
.Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync();
|
||||
});
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
|
||||
return result.IsSuccess ? "登记成功" : result.ErrorMessage;
|
||||
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "登记成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user