Пример #1
0
        public async Task <RabbitMqRecevieCallBackOutput> RabbitMqRecevieCallBack(RabbitMqRecevieCallBackInput input)
        {
            //var callback = RabbitMqRecevieCallBackFactory.CreateCallBack(input.MessageType);
            //var result = await callback.RabbitMqRecevieCallBack(input);


            var framGovUrl = _appConfiguration["RabbitMQ:frmsgovUrl"];

            var requestUrl = $"{framGovUrl}/api/services/app/project/GetProjectBudgetForEdit";
            var param      = new Dictionary <string, string>()
            {
                { "id", input.Parameter }
            };
            var result = await DoPost(requestUrl, param);

            try
            {
                var projectService = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IProjectAppService>();
                var projectModel   = JObject.Parse(result);
                var issuccess      = false;
                if (bool.TryParse(projectModel["success"].ToString(), out issuccess) && issuccess)
                {
                    var data       = projectModel["result"];
                    var baseOutPut = data["baseOutput"];
                    await projectService.CreateAsync(new CreateOrUpdateProJectBudgetManagerInput()
                    {
                        ProjectName   = baseOutPut["projectName"].ToString(),
                        ProjectCode   = baseOutPut["projectCode"].ToString(),
                        Days          = int.Parse(baseOutPut["days"].ToString()),
                        Gov_Code      = "FRMS",
                        Gov_ProjectId = Guid.Parse(baseOutPut["id"].ToString()),
                        FlowId        = Guid.Parse("27D705F7-A953-4F2C-9A4A-E68F7C085DA3"),
                        FlowTitle     = $"【财评中心】{baseOutPut["projectName"].ToString()}",
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            var ret = new RabbitMqRecevieCallBackOutput();

            ret.Result = RabbitMqCallBackResultType.Succesefull;
            return(ret);
        }
Пример #2
0
        public async Task <RabbitMqRecevieCallBackOutput> RabbitMqRecevieCallBack(RabbitMqRecevieCallBackInput input)
        {
            //var framGovUrl = _appConfiguration["RabbitMQ:frmsgovUrl"];

            //var requestUrl = $"{framGovUrl}/api/services/app/project/GetProjectBudgetForEdit";
            //var param = new Dictionary<string, string>()
            //    {
            //      {"id", input.Parameter}
            //     };
            //var result = await DoPost(requestUrl, param);
            //var projectService = AbpBootstrapper.Create<Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve<IProjectAppService>();
            //await projectService.CreateAsync(new CreateOrUpdateProJectBudgetManagerInput() { ProjectName = "测试rabbitMQ" });
            var ret = new RabbitMqRecevieCallBackOutput();

            ret.Result = RabbitMqCallBackResultType.Succesefull;
            return(ret);
        }