/// <summary>
        /// 根据流程定义增加节点  /   根据节点定义增加流程定义
        /// </summary>
        /// <param name="flowProcedureByNodeIdAddViewModel"></param>
        /// <returns></returns>
        public int ProcedureDefine_To_Node_Add(FlowProcedureByNodeIdAddViewModel flowProcedureByNodeIdAddViewModel)
        {
            var List = flowProcedureByNodeIdAddViewModel.relateNodeIdAndProcedureIdList;  //线路id和站点id列表

            for (int i = 0; i < List.Count; i++)
            {
                var nodeDefine_info        = _IFlowNodeDefineInfoRepository.GetInfoByNodeDefineId(List[i].Flow_NodeDefineId);
                var nodeDefine_info_update = _IMapper.Map <FlowProcedureByNodeIdAddMiddlecs, Flow_NodeDefine>(List[i], nodeDefine_info);
                _IFlowNodeDefineInfoRepository.Update(nodeDefine_info_update);
            }
            return(_IFlowNodeDefineInfoRepository.SaveChanges());
        }
Beispiel #2
0
        public ActionResult <FlowProcedureByNodeIdAddResModel> Manage_ProcedureDefineByNodeId_Add(FlowProcedureByNodeIdAddViewModel flowProcedureByNodeIdAddViewModel)
        {
            FlowProcedureByNodeIdAddResModel flowProcedureByNodeIdAddResModel = new FlowProcedureByNodeIdAddResModel();
            int UpdateRowNum = _IFlowNodeDefineService.ProcedureDefine_To_Node_Add(flowProcedureByNodeIdAddViewModel);

            if (UpdateRowNum > 0)
            {
                flowProcedureByNodeIdAddResModel.IsSuccess                  = true;
                flowProcedureByNodeIdAddResModel.AddCount                   = UpdateRowNum;
                flowProcedureByNodeIdAddResModel.baseViewModel.Message      = "根据流程定义增加节点/根据节点定义增加流程定义,成功";
                flowProcedureByNodeIdAddResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("根据流程定义增加节点/根据节点定义增加流程定义,成功");
                return(Ok(flowProcedureByNodeIdAddResModel));
            }
            else
            {
                flowProcedureByNodeIdAddResModel.IsSuccess                  = false;
                flowProcedureByNodeIdAddResModel.AddCount                   = 0;
                flowProcedureByNodeIdAddResModel.baseViewModel.Message      = "根据流程定义增加节点 / 根据节点定义增加流程定义,失败";
                flowProcedureByNodeIdAddResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("根据流程定义增加节点/根据节点定义增加流程定义,失败");
                return(Ok(flowProcedureByNodeIdAddResModel));
            }
        }