去除引用common.props
This commit is contained in:
@@ -5,7 +5,6 @@ using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.WorkFlow.Interfaces.Service;
|
||||
using JNPF.WorkFlow.Service;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -45,19 +44,19 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
string id = dic["id"];
|
||||
EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable<EqpRepairApply>().SingleAsync(x => x.id == id);
|
||||
return await _repository.GetSingleAsync(x => x.repair_apply_id==eqpRepairApply.id);
|
||||
return await _repository.GetSingleAsync(x => x.repair_apply_id == eqpRepairApply.id);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> OutApply(RepairOutApplyInput input)
|
||||
{
|
||||
EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable<EqpRepairApply>().SingleAsync(x=>x.id==input.repair_apply_id);
|
||||
EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable<EqpRepairApply>().SingleAsync(x => x.id == input.repair_apply_id);
|
||||
if (eqpRepairApply.status == RepairApplyStatus.TOBEOUTAPPLY ||
|
||||
eqpRepairApply.status == RepairApplyStatus.APPROVENOTPASS)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
string id = string.IsNullOrEmpty(input.id) ? SnowflakeIdHelper.NextId() : input.id;
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.id))
|
||||
{
|
||||
@@ -94,14 +93,14 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
|
||||
await db.Updateable<EqpRepairApply>()
|
||||
.SetColumns(x=>x.status == RepairApplyStatus.OUTAPPLYAPPROVE)
|
||||
.Where(x=>x.id==input.repair_apply_id).ExecuteCommandAsync();
|
||||
.SetColumns(x => x.status == RepairApplyStatus.OUTAPPLYAPPROVE)
|
||||
.Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
@@ -125,20 +124,20 @@ namespace Tnb.EquipMgr
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _repository.GetSingleAsync(x=>x.id==input.id);
|
||||
var entity = await _repository.GetSingleAsync(x => x.id == input.id);
|
||||
if (entity != null)
|
||||
{
|
||||
|
||||
await _flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
|
||||
await _flowTaskService.Update("", new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity?.flow_task_id??"",
|
||||
id = entity?.flow_task_id ?? "",
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
@@ -153,7 +152,7 @@ namespace Tnb.EquipMgr
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -164,13 +163,13 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
throw Oops.Bah("状态错误");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> Register(RepairApplyOutRegisterInput input)
|
||||
{
|
||||
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
@@ -187,7 +186,7 @@ namespace Tnb.EquipMgr
|
||||
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);
|
||||
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
|
||||
return result.IsSuccess ? "登记成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user