外修申请流程退回
This commit is contained in:
@@ -6,6 +6,7 @@ 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;
|
||||
using SqlSugar;
|
||||
@@ -24,11 +25,14 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
private readonly ISqlSugarRepository<EqpRepairOutApply> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IFlowTaskService _flowTaskService;
|
||||
private const string flowId = "26299060075302";
|
||||
private readonly FlowTaskService _flowTaskService;
|
||||
/// <summary>
|
||||
/// flow_templatejson 表的id
|
||||
/// </summary>
|
||||
private const string flowId = "26414803850262";
|
||||
|
||||
public EqpRepairOutApplyService(ISqlSugarRepository<EqpRepairOutApply> repository,
|
||||
IFlowTaskService flowTaskService,
|
||||
FlowTaskService flowTaskService,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
@@ -71,19 +75,19 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
await _repository.UpdateAsync(x=>new EqpRepairOutApply
|
||||
{
|
||||
repair_apply_id = input.repair_apply_id,
|
||||
equip_id = input.equip_id,
|
||||
supplier_id = input.supplier_id,
|
||||
estimated_cost = input.estimated_cost,
|
||||
construction_period_requirement = input.construction_period_requirement,
|
||||
out_apply_reason = input.out_apply_reason,
|
||||
remark = input.remark,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
approve_status = RepairOutApplyStatus.TOBEAPPROVE,
|
||||
},x=>x.id==input.id);
|
||||
// await _repository.UpdateAsync(x=>new EqpRepairOutApply
|
||||
// {
|
||||
// repair_apply_id = input.repair_apply_id,
|
||||
// equip_id = input.equip_id,
|
||||
// supplier_id = input.supplier_id,
|
||||
// estimated_cost = input.estimated_cost,
|
||||
// construction_period_requirement = input.construction_period_requirement,
|
||||
// out_apply_reason = input.out_apply_reason,
|
||||
// remark = input.remark,
|
||||
// create_id = _userManager.UserId,
|
||||
// create_time = DateTime.Now,
|
||||
// approve_status = RepairOutApplyStatus.TOBEAPPROVE,
|
||||
// },x=>x.id==input.id);
|
||||
}
|
||||
|
||||
await db.Updateable<EqpRepairApply>()
|
||||
@@ -99,25 +103,52 @@ namespace Tnb.EquipMgr
|
||||
//todo 退回流程
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
_flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
if (string.IsNullOrEmpty(input.id))
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
formData = new JObject()
|
||||
_flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _repository.GetSingleAsync(x=>x.id==input.id);
|
||||
_flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity.flow_task_id,
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
return result.IsSuccess ? "操作成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<ProjectReference Include="..\..\BasicData\Tnb.BasicData.Interfaces\Tnb.BasicData.Interfaces.csproj" />
|
||||
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow\Tnb.WorkFlow.csproj" />
|
||||
<ProjectReference Include="..\Tnb.EquipMgr.Interfaces\Tnb.EquipMgr.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user