예제 #1
0
 public SearchService(IAppSettings config, IUtilService util, ILookupRepository lookupRepository, ILogger <SearchService> logger)
 {
     _config           = config;
     _util             = util;
     _lookupRepository = lookupRepository;
     _logger           = logger;
 }
 public MassCrudController(FactoryManagementContext context, IRepositoryWrapper repositoryWrapper, IServiceWrapper serviceWrapper, ILoggerManager logger, IUtilService utilService)
 {
     _context           = context;
     _repositoryWrapper = repositoryWrapper;
     _serviceWrapper    = serviceWrapper;
     _logger            = logger;
     _utilService       = utilService;
 }
 public BusinessWrapperService(IServiceWrapper serviceWrapper,
                               IRepositoryWrapper repositoryWrapper,
                               IUtilService utilService)
 {
     this._repositoryWrapper = repositoryWrapper;
     this._serviceWrapper    = serviceWrapper;
     this._utilService       = utilService;
 }
예제 #4
0
 public BaseApiController(IWebApiContentService mainService)
     : base()
 {
     this.mainService      = mainService;
     this.htmlToViewHelper = mainService.HtmlToViewHelper;
     this.utilService      = mainService.UtilService;
     this.logService       = mainService.LogService;
     this.accountService   = mainService.AccountService;
 }
        public MembroCadastroController(
            IUtilService utilService,
            IEntidadeBaseRep <TemplateEmail> templateEmailRep,
            IEmailService emailService,
            ISmsService smsService,
            IEntidadeBaseRep <TemplateSms> templateSmsRep,
            IEntidadeBaseRep <Sms> smsRep,
            IEntidadeBaseRep <Emails> emailsRep,


            IEntidadeBaseRep <Fornecedor> fornecedorRep,
            IEntidadeBaseRep <MembroFornecedor> membroFornecedorRep,
            IEntidadeBaseRep <FornecedorRegiao> fornecedorRegiaoRep,
            IEntidadeBaseRep <FornecedorFormaPagto> fornecedorFormaPagtRep,
            IEntidadeBaseRep <MembroCategoria> membeoCategoriaRep,
            IEntidadeBaseRep <Telefone> telefoneRep,
            IEntidadeBaseRep <Usuario> usuarioRep,
            IEntidadeBaseRep <Pessoa> pessoaRep,
            IEntidadeBaseRep <PessoaJuridica> pessoaJuridicaRep,
            IEntidadeBaseRep <PessoaFisica> pessoaFisicaRep,
            IEntidadeBaseRep <Membro> membroRep,
            IEntidadeBaseRep <Regiao> regiaoMembroRep,
            IEntidadeBaseRep <TemplateEmail> templateEmail,
            IEntidadeBaseRep <Emails> emailsNotificaFornecedorMembro,
            IEntidadeBaseRep <SolicitacaoMembroFornecedor> solicitacaoMembroFornecedor,
            IEntidadeBaseRep <FornecedorCategoria> fornecedorCategoria,
            IEntidadeBaseRep <AvaliacaoFornecedor> avaliacaofornecedor,
            IEntidadeBaseRep <Avisos> avisosRep,
            IEntidadeBaseRep <FornecedorPrazoSemanal> fornecedorPrazoSemanalRep,

            IEntidadeBaseRep <Erro> errosRepository, IUnitOfWork unitOfWork)
            : base(usuarioRep, errosRepository, unitOfWork)
        {
            _pessoaRep                      = pessoaRep;
            _pessoaJuridicaRep              = pessoaJuridicaRep;
            _pessoaFisicaRep                = pessoaFisicaRep;
            _membroRep                      = membroRep;
            _usuarioRep                     = usuarioRep;
            _telefoneRep                    = telefoneRep;
            _membeoCategoriaRep             = membeoCategoriaRep;
            _membroFornecedorRep            = membroFornecedorRep;
            _fornecedorRep                  = fornecedorRep;
            _fornecedorRegiaoRep            = fornecedorRegiaoRep;
            _fornecedorFormaPagtRep         = fornecedorFormaPagtRep;
            _regiaoMembroRep                = regiaoMembroRep;
            _smsService                     = smsService;
            _utilService                    = utilService;
            _templateEmail                  = templateEmail;
            _emailsNotificaFornecedorMembro = emailsNotificaFornecedorMembro;
            _solicitacaoMembroFornecedor    = solicitacaoMembroFornecedor;
            _fornecedorCategoria            = fornecedorCategoria;
            _sms       = smsRep;
            _emailsRep = emailsRep;
            _avaliacaofornecedorRep = avaliacaofornecedor;
            _avisosRep = avisosRep;
            _fornecedorPrazoSemanalRep = fornecedorPrazoSemanalRep;
        }
예제 #6
0
        public ReviewController(IRepositoryReview repositoryReview,

                                IUtilService utilService,
                                IUserService userService)
        {
            _repositoryReview = repositoryReview;

            _utilService = utilService;
            _userService = userService;
        }
예제 #7
0
        public CommentController(
            IRepositoryComment repositoryComment,

            IUtilService utilService,
            IUserService userService)
        {
            _repositoryComment = repositoryComment;

            _utilService = utilService;
            _userService = userService;
        }
예제 #8
0
 public ConsolidatedMonthUserData()
 {
     ListWorkItem       = new List <WorkItemSerialized>();
     ChargeableHours    = 0;
     NonChargeableHours = 0;
     //TotalHours = 0;
     _readJsonFilesService = new ReadJsonFiles();
     _utilService          = new UtilService();
     //Vat_Fee = _utilService.FetchActiveVat();
     //Vat_Fee = _utilService.FetchVatByDate(this.ListWorkItem.First().StartDate.Value);
 }
예제 #9
0
 public GeoLogController(
     DataContext context,
     IUtilService utilService,
     IMapper mapper,
     IHostingEnvironment hostingEnvironment)
 {
     _context            = context;
     _repo               = utilService;
     _mapper             = mapper;
     _hostingEnvironment = hostingEnvironment;
 }
예제 #10
0
 public CreateUserHandler(UserManager <ApplicationUser> userManager,
                          ICurrentUserService currentUserService, IDateTime dateTime, IMediator mediator,
                          IUtilService utilService, IMapper mapper, IApplicationDbContext context) : base(context)
 {
     _userManager        = userManager;
     _currentUserService = currentUserService;
     _dateTime           = dateTime;
     _mediator           = mediator;
     _utilService        = utilService;
     _mapper             = mapper;
     _context            = context;
 }
예제 #11
0
        public ActionResult <IEnumerable <string> > Get([FromServices] IUtilService service)
        {
            //var log = factory.CreateLogger<ValuesController>();
            //log.LogDebug("我的日志");
            //log.LogError(new Exception("用户登录错处"), "系统出错了");

            //NLog.ILogger logger = NLog.LogManager.GetCurrentClassLogger();

            //service.Test();

            return(new string[] { "value1", "value2" });
        }
예제 #12
0
        protected override string OnExecute()
        {
            SpRequestMsg pSpRequestMsg = new SpRequestMsg();

            pSpRequestMsg.data = "";
            DataTable dtDetail = null;

            try
            {
                //获取传入参数
                var    dic     = RequestData.FromJson <Dictionary <string, string> >();
                string xjjd    = dic.ContainsKey("xjjd") ? dic["xjjd"] : "";//序号
                string xjwd    = dic.ContainsKey("xjwd") ? dic["xjwd"] : "";
                string xjguid  = dic.ContainsKey("guid") ? dic["guid"] : "";
                string xjyh    = dic.ContainsKey("xjyh") ? dic["xjyh"] : "";//巡检用户cid
                string dateJWD = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                if (string.IsNullOrEmpty(xjguid))
                {
                    pSpRequestMsg.success = false;
                    pSpRequestMsg.message = "巡检返回ID为空";
                    return(pSpRequestMsg.ToNormalJson());
                }
                if (string.IsNullOrEmpty(xjjd))
                {
                    pSpRequestMsg.success = false;
                    pSpRequestMsg.message = "巡检上报经度坐标为空!";
                    return(pSpRequestMsg.ToNormalJson());
                }
                if (string.IsNullOrEmpty(xjwd))
                {
                    pSpRequestMsg.success = false;
                    pSpRequestMsg.message = "巡检上报纬度坐标为空!";
                    return(pSpRequestMsg.ToNormalJson());
                }
                IUtilService utilService = SpServiceFactory.CreateUtilService();

                dtDetail = utilService.QueryInsertJWDData(xjjd, xjwd, xjguid, dateJWD, xjyh);
                //  pSpRequestMsg.data = dtDetail.ToJson();
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "上报坐标请求异常,详情" + ex.Message;
                Log.Error("上报坐标请求异常:" + ex.Message.ToString());
                return(pSpRequestMsg.ToNormalJson());
            }
            return(dtDetail.ToJsonStore(true, dtDetail.Rows.Count));
            // return pSpRequestMsg.ToNormalJson();
        }
예제 #13
0
        public TripService(
            IRepositoryTrip tripRepository,
            IRepositoryHistoryTrip repositoryHistoryTrip,

            IHistoryTripService historyTripService,
            IUserService userService,
            IUtilService utilService)
        {
            _repositoryTrip        = tripRepository;
            _repositoryHistoryTrip = repositoryHistoryTrip;

            _historyTripService = historyTripService;
            _utilService        = utilService;
            _userService        = userService;
        }
예제 #14
0
 public AuthController(
     FactoryManagementContext context,
     IRepositoryWrapper repositoryWrapper,
     IServiceWrapper serviceWrapper,
     ILoggerManager logger,
     IUtilService utilService,
     IBusinessService businessService)
 {
     _context           = context;
     _repositoryWrapper = repositoryWrapper;
     _serviceWrapper    = serviceWrapper;
     _logger            = logger;
     _utilService       = utilService;
     _businessService   = businessService;
 }
        public EmailController(IEntidadeBaseRep <Sms> smsRep, IEmailService emailService, IUtilService utilEmailService, IEntidadeBaseRep <Usuario> usuarioRep, IEntidadeBaseRep <Erro> _errosRepository, IUnitOfWork _unitOfWork,


                               IEntidadeBaseRep <Membro> membroRep,
                               IEntidadeBaseRep <Fornecedor> fornecedorRep
                               )
            : base(usuarioRep, _errosRepository, _unitOfWork)
        {
            _smsRep           = smsRep;
            _usuarioRep       = usuarioRep;
            _emailService     = emailService;
            _utilEmailService = utilEmailService;
            _membroRep        = membroRep;;
            _fornecedorRep    = fornecedorRep;
        }
 public MembroDemandaController(IUtilService utilService, IEntidadeBaseRep <TemplateEmail> templateEmailRep, IEmailService emailService, ISmsService smsService, IEntidadeBaseRep <TemplateSms> templateSmsRep, IEntidadeBaseRep <Sms> smsRep, IEntidadeBaseRep <MembroDemanda> membroDemandaRep, IEntidadeBaseRep <MembroCategoria> membroCategoriaRep, IEntidadeBaseRep <Usuario> usuarioRep, IEntidadeBaseRep <Pessoa> pessoaRep, IEntidadeBaseRep <PessoaJuridica> pessoaJuridicaRep, IEntidadeBaseRep <Membro> membroRep, IEntidadeBaseRep <Erro> _errosRepository, IUnitOfWork _unitOfWork)
     : base(usuarioRep, _errosRepository, _unitOfWork)
 {
     _pessoaRep          = pessoaRep;
     _pessoaJuridicaRep  = pessoaJuridicaRep;
     _membroRep          = membroRep;
     _usuarioRep         = usuarioRep;
     _membroDemandaRep   = membroDemandaRep;
     _membroCategoriaRep = membroCategoriaRep;
     _emailService       = emailService;
     _templateEmailRep   = templateEmailRep;
     _smsService         = smsService;
     _templateSmsRep     = templateSmsRep;
     _smsRep             = smsRep;
     _utilService        = utilService;
 }
예제 #17
0
        protected override string OnExecute()
        {
            SpRequestMsg pSpRequestMsg  = new SpRequestMsg();
            DataTable    dtDetail       = null;
            string       pRequestguid   = string.Empty;
            HttpContext  context        = this.SpContext as HttpContext;
            string       dateStart      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string       InspectionGuid = string.Empty;
            string       sqlSelectguid  = "select max(cid) from p_gas_inspection";
            DataTable    dtGetguid      = new DataTable();

            dtGetguid = ApplicationManager.DefaultConnection.QueryData(sqlSelectguid).Tables[0];
            if (dtGetguid.Rows[0][0].ToString() == "")
            {
                InspectionGuid = "1";
            }
            if (dtGetguid.Rows[0][0].ToString() != "")
            {
                int maxguid = Convert.ToInt32(dtGetguid.Rows[0][0]) + 1;
                InspectionGuid = Convert.ToString(maxguid);
            }
            string           xjjd = context.Request["xjjd"] ?? ""; //经度
            string           xjwd = context.Request["xjwd"] ?? ""; //纬度
            string           xjdz = context.Request["xjdz"] ?? ""; //巡检地址
            string           xjyh = context.Request["xjyh"] ?? ""; //巡检用户cid
            SpPagingResponse pSpPagingResponse = new SpPagingResponse();
            IUtilService     service           = SpServiceFactory.CreateUtilService();

            try
            {
                dtDetail = service.QueryInspectionData(InspectionGuid, dateStart, xjjd, xjwd, xjdz, xjyh);

                pSpRequestMsg.success = true;
                pSpRequestMsg.message = "巡检开始成功";
                pSpRequestMsg.data    = pRequestguid;
                pRequestguid          = ValueHelper.DataTable2Json(dtDetail);
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "巡检获取异常,详情" + ex.Message;
                pSpRequestMsg.data    = "";
                Log.Error("巡检详情获取异常:" + ex.Message.ToString());
                return(pSpRequestMsg.ToNormalJson());
            }
            return(dtDetail.ToJsonStore(true, dtDetail.Rows.Count));
        }
예제 #18
0
        protected override string OnExecute()
        {
            SpRequestMsg pSpRequestMsg  = new SpRequestMsg();
            string       pRequestguid   = string.Empty;
            string       pRequestzpwjmc = string.Empty;
            var          dic            = RequestData.FromJson <Dictionary <string, string> >();

            pRequestguid   = dic.ContainsKey("guid") ? dic["guid"] : "";//序号
            pRequestzpwjmc = dic.ContainsKey("image") ? dic["image"] : "";
            if (string.IsNullOrEmpty(pRequestguid))
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "返回guid为空!";
                pSpRequestMsg.data    = "";
                return(pSpRequestMsg.ToNormalJson());
            }
            if (string.IsNullOrEmpty(pRequestzpwjmc))
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "传入图片为空!";
                pSpRequestMsg.data    = "";
                return(pSpRequestMsg.ToNormalJson());
            }
            SpPagingResponse pSpPagingResponse = new SpPagingResponse();
            IUtilService     service           = SpServiceFactory.CreateUtilService();

            try
            {
                string    NameImg  = ValueHelper.ToImage(pRequestzpwjmc);
                DataTable dtDetail = service.QueryInsertImage(pRequestguid, NameImg);
                pSpRequestMsg.success = true;
                pSpRequestMsg.message = "插入图片成功";
                pSpRequestMsg.data    = dtDetail.ToJson();
                pRequestguid          = ValueHelper.DataTable2Json(dtDetail);
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "插入信息获取异常,详情" + ex.Message;
                pSpRequestMsg.data    = "";
                Log.Error("插入信息详情获取异常:" + ex.Message.ToString());
            }

            return(pSpRequestMsg.ToNormalJson());
            // return pRequestguid;
        }
예제 #19
0
        protected override string OnExecute()
        {
            SpRequestMsg     pSpRequestMsg     = new SpRequestMsg();
            SpRequestMsgData pSpRequestMsgdata = new SpRequestMsgData();
            DataTable        dtDetail          = null;
            string           JsonData          = string.Empty;
            string           tableName         = "p_user";   //用户信息
            string           fields            = "xm,dh,wx"; //返回字段
            HttpContext      context           = this.SpContext as HttpContext;
            string           cid = context.Request["usercid"] ?? "";

            // string cid = ValueHelper.pwdcid;
            if (string.IsNullOrEmpty(cid))
            {
                pSpRequestMsgdata.success  = false;
                pSpRequestMsgdata.message  = "唯一标识不能为空!";
                pSpRequestMsgdata.Jsondata = "";
                return(JsonData);
            }
            string           strWhere          = string.Format("cid={0}", cid);
            SpPagingResponse pSpPagingResponse = new SpPagingResponse();
            IUtilService     service           = SpServiceFactory.CreateUtilService();

            try
            {
                dtDetail = service.QueryUserData(fields, tableName, strWhere, cid);
                pSpRequestMsgdata.success = true;
                pSpRequestMsgdata.message = "用户详情获取成功";
                JsonData = ValueHelper.DataTable2Json(dtDetail);
                pSpRequestMsgdata.Jsondata = JsonData;
            }
            catch (Exception ex)
            {
                pSpRequestMsgdata.success  = false;
                pSpRequestMsgdata.message  = "用户详情获取异常,详情" + ex.Message;
                pSpRequestMsgdata.Jsondata = "";
                Log.Error("用户详情获取异常:" + ex.Message.ToString());
                return(pSpRequestMsg.ToNormalJson());
            }

            // return JsonData;
            return(dtDetail.ToJsonStore(true, dtDetail.Rows.Count));
        }
예제 #20
0
        protected override string OnExecute()
        {
            HttpContext context = this.SpContext as HttpContext;

            try
            {
                string tableName   = "p_terminal";                     //设备表
                string fields      = "cid,sbbm,sbmc,jxh,jd,wd";        //返回字段
                string whereClause = context.Request["keyWord"] ?? ""; //where部分
                string strPage     = context.Request["start"] ?? "1";  //
                string strPageSize = context.Request["pageSize"] ?? "15";
                string sort        = context.Request["sort"] ?? "";
                string userName    = context.Request["userName"] ?? "";
                int    page        = Convert.ToInt32(strPage);
                if (page <= 0)
                {
                    page = 1;
                }
                if (!string.IsNullOrEmpty(whereClause))
                {
                    whereClause = string.Format("where CONCAT(IFNULL(sbmc,''),' ',IFNULL(sbbm,''),' ',IFNULL(jxh,'')) LIKE '%{0}%'", whereClause);
                }
                int           pageSize       = Convert.ToInt32(strPageSize);
                SpPagingParam pSpPagingParam = new SpPagingParam()
                {
                    tableName   = tableName,
                    pageSize    = pageSize,
                    page        = page,
                    sort        = sort,
                    whereClause = whereClause,
                    fields      = fields
                };
                IUtilService utilService = SpServiceFactory.CreateUtilService();
                int          total       = 0;
                DataTable    dtResult    = utilService.QueryPageTable(pSpPagingParam, ref total);
                return(this.ToJsonP(dtResult.ToStandardJson(true, total, "分页列表数据")));
            }
            catch (Exception ex)
            {
                Log.Error("分页查询异常:" + ex.Message.ToString());
                throw ex;
            }
        }
예제 #21
0
        protected override string OnExecute()
        {
            SpRequestMsg pSpRequestMsg = new SpRequestMsg();
            string       JsonData      = string.Empty;
            string       tableName     = "p_terminal";                                             //设备表
            string       fields        = "cid,jxh,sbbm,jkfl,sbmc,jd,wd,jdmc,lxdh,ssdw,dwdz,dwlxr"; //返回字段
            HttpContext  context       = this.SpContext as HttpContext;
            string       cid           = context.Request["cid"] ?? "";

            if (string.IsNullOrEmpty(cid))
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "设备唯一标识不能为空!";
                pSpRequestMsg.data    = "";
                return(pSpRequestMsg.ToNormalJson());
            }
            string strWhere = string.Format("cid={0}", cid);

            ValueHelper.TerminalCid = cid;
            SpPagingResponse pSpPagingResponse = new SpPagingResponse();
            IUtilService     service           = SpServiceFactory.CreateUtilService();
            DataTable        dtDetail          = null;

            try
            {
                dtDetail = service.QueryData(fields, tableName, strWhere, cid);
                pSpRequestMsg.success = true;
                pSpRequestMsg.message = "设备详情获取成功";
                pSpRequestMsg.data    = JsonData;
                JsonData = ValueHelper.DataTable2Json(dtDetail);
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "设备详情获取异常,详情" + ex.Message;
                // pSpRequestMsg.data = "";
                Log.Error("设备详情获取异常:" + ex.Message.ToString());
                return(pSpRequestMsg.ToNormalJson());
            }
            // return JsonData;//返回json字符串数据
            //return pSpRequestMsg.ToNormalJson();
            return(dtDetail.ToJsonStore(true, dtDetail.Rows.Count));
        }
예제 #22
0
        public TripController(IRepositoryTrip tripRepository,
                              IRepositoryHistoryTrip historyRepository,

                              ITripService tripService,
                              IUtilService utilService,
                              IUserService userService,
                              IUnitOfWorkService unitOfWorkService,

                              IWebHostEnvironment webHostEnvironment)
        {
            _repositoryTrip        = tripRepository;
            _repositoryHistoryTrip = historyRepository;

            _tripService       = tripService;
            _utilService       = utilService;
            _userService       = userService;
            _unitOfWorkService = unitOfWorkService;

            _webHostEnvironment = webHostEnvironment;
        }
        public TrocaItemFornecedorController(IEntidadeBaseRep <Produto> produtoRep,
                                             IEntidadeBaseRep <StatusSistema> statusSisRep,
                                             IEntidadeBaseRep <Membro> membroRep,
                                             IEntidadeBaseRep <Pedido> pedidoRep,
                                             IEntidadeBaseRep <Fornecedor> fornecedorRep,
                                             IEntidadeBaseRep <HistStatusPedido> histStatusPedido,
                                             IEntidadeBaseRep <HistStatusCotacao> histStatusCotacao,
                                             IEntidadeBaseRep <Usuario> usuarioRep,
                                             IEntidadeBaseRep <ItemPedido> itemPedidoRep,
                                             IEntidadeBaseRep <AvaliacaoFornecedor> avaliacaoFornecedorRep,
                                             IEntidadeBaseRep <MembroCategoria> membroCategoriaRep,
                                             IEntidadeBaseRep <ResultadoCotacao> resultadoCotacaoRep,
                                             IEntidadeBaseRep <Cotacao> cotacaoRep,
                                             IEntidadeBaseRep <CotacaoPedidos> cotacaoPedidosRep,
                                             IEntidadeBaseRep <FornecedorFormaPagto> fornecedorFormaPagtoRep,

                                             INotificacoesAlertasService notificacoesAlertaService,
                                             IUtilService utilServiceRep,

                                             IEntidadeBaseRep <Erro> _errosRepository, IUnitOfWork _unitOfWork)
            : base(usuarioRep, _errosRepository, _unitOfWork)
        {
            _usuarioRep              = usuarioRep;
            _pedidoRep               = pedidoRep;
            _fornecedorRep           = fornecedorRep;
            _histStatusPedido        = histStatusPedido;
            _histStatusCotacao       = histStatusCotacao;
            _membroRep               = membroRep;
            _statusSisRep            = statusSisRep;
            _produtoRep              = produtoRep;
            _itemPedidoRep           = itemPedidoRep;
            _avaliacaoFornecedorRep  = avaliacaoFornecedorRep;
            _membroCategoriaRep      = membroCategoriaRep;
            _resultadoCotacaoRep     = resultadoCotacaoRep;
            _cotacaoRep              = cotacaoRep;
            _cotacaoPedidosRep       = cotacaoPedidosRep;
            _fornecedorFormaPagtoRep = fornecedorFormaPagtoRep;

            _notificacoesAlertaService = notificacoesAlertaService;
            _utilServiceRep            = utilServiceRep;
        }
예제 #24
0
        protected override string OnExecute()
        {
            DataTable    dtDetail      = null;
            SpRequestMsg pSpRequestMsg = new SpRequestMsg();
            string       pRequestguid  = string.Empty;
            HttpContext  context       = this.SpContext as HttpContext;
            string       Inspectguid   = context.Request["xjguid"] ?? "";
            string       xjjd          = context.Request["xjjd"] ?? "";
            string       xjwd          = context.Request["xjwd"] ?? "";
            string       xjdz          = context.Request["xjdz"] ?? "";
            string       xjyh          = context.Request["xjyh"] ?? "";//巡检用户cid
            string       dateStop      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            if (string.IsNullOrEmpty(Inspectguid))
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "返回guid为空!";
                pSpRequestMsg.data    = "";
                return(pSpRequestMsg.ToNormalJson());
            }
            SpPagingResponse pSpPagingResponse = new SpPagingResponse();
            IUtilService     service           = SpServiceFactory.CreateUtilService();

            try
            {
                dtDetail = service.QueryInsertExitDate(Inspectguid, dateStop, xjjd, xjwd, xjdz, xjyh);
                pSpRequestMsg.success = true;
                pSpRequestMsg.message = "巡检结束成功";
                pSpRequestMsg.data    = dtDetail.ToJson();
                pRequestguid          = ValueHelper.DataTable2Json(dtDetail);
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "巡检获取异常,详情" + ex.Message;
                pSpRequestMsg.data    = "";
                Log.Error("巡检详情获取异常:" + ex.Message.ToString());
                return(pSpRequestMsg.ToNormalJson());
            }
            return(dtDetail.ToJsonStore(true, dtDetail.Rows.Count));
        }
 public EstoqueController(IEntidadeBaseRep <Estoque> estoqueRep,
                          IEntidadeBaseRep <Endereco> enderecoRep,
                          IEntidadeBaseRep <Usuario> usuarioRep,
                          IEntidadeBaseRep <Produto> produtoRep,
                          IEntidadeBaseRep <Membro> membroRep,
                          IEntidadeBaseRep <MembroCategoria> membroCategoriaRep,
                          IEntidadeBaseRep <SubCategoria> subcategoriaRep,
                          IUtilService ultilService,
                          IEntidadeBaseRep <Erro> _errosRepository,
                          IUnitOfWork _unitOfWork)
     : base(usuarioRep, _errosRepository, _unitOfWork)
 {
     _estoqueRep         = estoqueRep;
     _usuarioRep         = usuarioRep;
     _enderecoRep        = enderecoRep;
     _produtoRep         = produtoRep;
     _membroRep          = membroRep;
     _membroCategoriaRep = membroCategoriaRep;
     _subcategoriaRep    = subcategoriaRep;
     _ultilService       = ultilService;
 }
예제 #26
0
        public PayableService(IRepositoryWrapper repositoryWrapper, IUtilService utilService)
        {
            this._repositoryWrapper = repositoryWrapper;

            this._utilService = utilService;
        }
예제 #27
0
        //public FactoryAuthorize(IRepositoryWrapper repositoryWrapper,
        //    IServiceWrapper serviceWrapper)
        //{
        //    _repositoryWrapper = repositoryWrapper;
        //    _serviceWrapper = serviceWrapper;

        //}
        public void OnAuthorization(AuthorizationFilterContext filterContext)
        {
            var services = filterContext.HttpContext.RequestServices;

            _repositoryWrapper = (IRepositoryWrapper)services.GetService(typeof(IRepositoryWrapper));
            _serviceWrapper    = (IServiceWrapper)services.GetService(typeof(IServiceWrapper));
            _utilService       = (IUtilService)services.GetService(typeof(IUtilService));
            _context           = new FactoryManagementContext();


            var actionName = "";
            var ctrlName   = "";

            Microsoft.Extensions.Primitives.StringValues authorizationToken;
            filterContext.HttpContext.Request.Headers.TryGetValue("Authorization", out authorizationToken);


            if (filterContext != null)
            {
                var _token = authorizationToken.FirstOrDefault();

                if (_token != null && _token.Substring(7) != "null")
                {
                    string authToken = _token;
                    if (authToken != null)
                    {
                        #region Decoding Token
                        JwtSecurityToken claims = _serviceWrapper.UserAuthInfoService.DecodeJwtToken(authorizationToken.FirstOrDefault().Substring(7));
                        var userId      = claims.Claims.Where(x => x.Type == "UserId").FirstOrDefault().Value;
                        var userName    = claims.Claims.Where(x => x.Type == "UserName").FirstOrDefault().Value;
                        var factoryName = claims.Claims.Where(x => x.Type == "FactoryName").FirstOrDefault().Value;
                        var factoryId   = claims.Claims.Where(x => x.Type == "FactoryId").FirstOrDefault().Value;

                        var  mvcContext     = filterContext;
                        bool hasAccessRight = false;
                        var  descriptor     = mvcContext?.ActionDescriptor as ControllerActionDescriptor;
                        if (descriptor != null)
                        {
                            actionName = descriptor.ActionName;
                            ctrlName   = descriptor.ControllerName;
                        }
                        UserRole roleVm = GetUserRole(userId);
                        if (roleVm.Role.Name == "SUPER_ADMIN")
                        {
                            filterContext.HttpContext.Response.Headers.Add("authToken", authToken);
                            filterContext.HttpContext.Response.Headers.Add("AuthStatus", "Authorized");
                            filterContext.HttpContext.Response.Headers.Add("storeAccessiblity", "Authorized");
                            return;
                        }

                        ApiResourceMappingVM vm = GetApiResourceMapping(ctrlName, actionName);
                        // UserRole roleVm = GetUserRole(userId);

                        var property = vm.Resource == "Common" ? null : roleVm.Role.GetType().GetProperty(vm.Resource);
                        if (vm.Resource == "Common")
                        {
                            hasAccessRight = true;
                        }

                        else if (property != null)
                        {
                            hasAccessRight = (bool)property.GetValue(roleVm.Role);
                        }
                        #endregion
                        if (IsValidToken(authToken.Substring(7)) && hasAccessRight)
                        {
                            filterContext.HttpContext.Response.Headers.Add("authToken", authToken);
                            filterContext.HttpContext.Response.Headers.Add("AuthStatus", "Authorized");

                            filterContext.HttpContext.Response.Headers.Add("storeAccessiblity", "Authorized");

                            return;
                        }
                        else
                        {
                            filterContext.HttpContext.Response.Headers.Add("authToken", authToken);
                            filterContext.HttpContext.Response.Headers.Add("AuthStatus", "NotAuthorized");

                            filterContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
                            filterContext.HttpContext.Response.HttpContext.Features.Get <IHttpResponseFeature>().ReasonPhrase = "Not Authorized";
                            filterContext.Result = new JsonResult("NotAuthorized")
                            {
                                Value = new
                                {
                                    Status  = "Error",
                                    Message = "Invalid Token"
                                },
                            };
                        }
                    }
                }
                else
                {
                    filterContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.ExpectationFailed;
                    filterContext.HttpContext.Response.HttpContext.Features.Get <IHttpResponseFeature>().ReasonPhrase = "Please Provide authToken";
                    filterContext.Result = new JsonResult("Please Provide authToken")
                    {
                        Value = new
                        {
                            Status  = "Error",
                            Message = "Please Provide authToken"
                        },
                    };
                }
            }
        }
예제 #28
0
 public UtilsServiceTest(IUtilService service, ILogger logger)
 {
     _service = service;
     _logger  = logger;
 }
예제 #29
0
        public StockInService(IRepositoryWrapper repositoryWrapper, IUtilService utilService)
        {
            this._repositoryWrapper = repositoryWrapper;

            this._utilService = utilService;
        }
 public AuthController(UserManager <IdentityUser> userManager, IConfiguration configuration, IUtilService utilService)
 {
     _userManager   = userManager;
     _configuration = configuration;
     _utilService   = utilService;
 }
예제 #31
0
 public void InitService()
 {
     this.connection = ServiceUtil.Instance.Connection;
     this.fileService = ServiceUtil.Instance.FileService;
     this.dataService = ServiceUtil.Instance.DataService;
     this.sessionService = ServiceUtil.Instance.SessionService;
     this.imageService = ServiceUtil.Instance.ImageService;
     this.utilService = ServiceUtil.Instance.utilService;
     this.wsClient = ServiceUtil.Instance.WsClient;
     this.logger = ServiceUtil.Instance.Logger;
     this.inWindow = (this.dataService.INWindow as INWindow);
     this.AddEventListenerHandler();
 }