Browse Source

Añadir notificación de sincronización y backup de nitrógeno.

dev
marcelcosta 2 years ago
parent
commit
cb38ea347d
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      BDAccess/app.R

+ 4
- 0
BDAccess/app.R

@ -754,6 +754,7 @@ server <- function(input, output) {
sqlFetch(dta, "NITROGEN"), sqlFetch(dta, "NITROGEN"),
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","UM-Nitrogen.xlsx") file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","UM-Nitrogen.xlsx")
) )
print("Backup Creado.")
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx")) table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
@ -784,6 +785,7 @@ server <- function(input, output) {
sqlDrop(dta, "NITROGEN") sqlDrop(dta, "NITROGEN")
sqlSave(dta, table.um %>% select(-FECHA) %>% filter(!is.na(CODIGO)), tablename="NITROGEN", rownames=F) sqlSave(dta, table.um %>% select(-FECHA) %>% filter(!is.na(CODIGO)), tablename="NITROGEN", rownames=F)
print("Tabla Actualizada.")
} }
if (input$dbtype == "OV"){ if (input$dbtype == "OV"){
## Copia de backup ## Copia de backup
@ -797,6 +799,7 @@ server <- function(input, output) {
sqlFetch(dta, "NITROGEN"), sqlFetch(dta, "NITROGEN"),
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","OV-Nitrogen.xlsx") file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","OV-Nitrogen.xlsx")
) )
print("Backup Creado.")
## Lectura del excel ## Lectura del excel
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx")) table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
@ -822,6 +825,7 @@ server <- function(input, output) {
sqlDrop(dta, "NITROGEN") sqlDrop(dta, "NITROGEN")
sqlSave(dta, table.ov, tablename="NITROGEN", rownames=F) sqlSave(dta, table.ov, tablename="NITROGEN", rownames=F)
print("Tabla Actualizada.")
} }
}) })

Loading…
Cancel
Save