Browse Source

Refactorização

master
andrebarros7201 5 years ago
parent
commit
669fa2774f
18 changed files with 1137 additions and 335 deletions
  1. BIN
      dbs/dbmercearia.mv.db
  2. +748
    -0
      dbs/dbmercearia.trace.db
  3. +174
    -167
      public/scripts/main.js
  4. +1
    -1
      public/scripts/main.js.map
  5. +0
    -0
      server/services/categorias/get.js
  6. +0
    -0
      server/services/lojas/get.js
  7. +10
    -0
      server/services/lojas/produtos/post.js
  8. +0
    -0
      server/services/produtos/get.js
  9. +0
    -11
      server/services/produtosLoja.js
  10. +3
    -3
      server/setup/_schema-form-3-produto.js
  11. +88
    -0
      server/setup/_schema-form-4-produto_loja.js
  12. +1
    -0
      ui/package.json
  13. +10
    -33
      ui/src/components/TabelaCategorias/index.jsx
  14. +19
    -36
      ui/src/components/TabelaLoja/JanelaStock/index.jsx
  15. +21
    -48
      ui/src/components/TabelaLoja/index.jsx
  16. +11
    -33
      ui/src/components/TabelaProdutos/index.jsx
  17. +4
    -3
      ui/src/containers/DashboardContainer/index.jsx
  18. +47
    -0
      ui/src/utils/Service.js

BIN
dbs/dbmercearia.mv.db View File


+ 748
- 0
dbs/dbmercearia.trace.db View File

@ -4680,3 +4680,751 @@ org.h2.jdbc.JdbcSQLDataException: Invalid value "1" for parameter "parameterInde
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:14:18 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "lojas" not found; SQL statement:
select lojas from produto [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.command.dml.Select.prepare(Select.java:1256)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:20:38 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto.lojas" not found; SQL statement:
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join loja on produto.lojas = loja.id
where loja.id = 3 [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:205)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:25:40 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto.lojas" not found; SQL statement:
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join loja on produto.lojas = loja.id
where loja.id = 3 [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:205)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:32:54 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto_loja.loja" not found; SQL statement:
select produto.nome, loja.mercearia
from produto
inner join produto_loja on produto.loja_id = produto_loja.loja_id
inner join loja on produto_loja.loja = loja.id [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:205)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:37:48 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "select produto.nome, loja.mercearia
from produto, loja,
where[*] produto_loja.loja_id = produto.loja_id
and loja.id = produto_loja.loja_id
"; expected "identifier"; SQL statement:
select produto.nome, loja.mercearia
from produto, loja,
where produto_loja.loja_id = produto.loja_id
and loja.id = produto_loja.loja_id
[42001-198]
2021-03-25 11:40:13 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema "loja" not found; SQL statement:
select produto.nome, loja.mercearia
from produto
inner join produto_loja on produto_loja.loja_id = produto.lojas
inner join loja.id = produto.lojas [90079-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.command.Parser.readTableFilter(Parser.java:1866)
at org.h2.command.Parser.readJoin(Parser.java:2295)
at org.h2.command.Parser.parseJoinTableFilter(Parser.java:2655)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2644)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2790)
at org.h2.command.Parser.parseSelectSub(Parser.java:2638)
at org.h2.command.Parser.parseSelectUnion(Parser.java:2471)
at org.h2.command.Parser.parseSelect(Parser.java:2442)
at org.h2.command.Parser.parsePrepared(Parser.java:815)
at org.h2.command.Parser.parse(Parser.java:789)
at org.h2.command.Parser.parse(Parser.java:761)
at org.h2.command.Parser.prepareCommand(Parser.java:684)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:40:27 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto.lojas" not found; SQL statement:
select produto.nome, loja.mercearia
from produto
inner join produto_loja on produto_loja.loja_id = produto.lojas
inner join loja on loja.id = produto.lojas [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:207)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:40:32 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto.lojas" not found; SQL statement:
select produto.nome, loja.mercearia
from produto
inner join produto_loja on produto_loja.loja_id = produto.lojas
inner join loja on loja.id = produto.loja_id [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:207)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:40:40 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "produto.lojas" not found; SQL statement:
select produto.nome, loja.mercearia
from produto
inner join produto_loja on produto_loja.loja_id = produto.lojas
inner join loja on loja.id = produto_loja.loja_id [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:207)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:49:06 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema "produto_loja" not found; SQL statement:
select produto.nome from produto
inner join produto_loja.produto_id = produto.id
where produto_loja.loja_id = 3 [90079-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.command.Parser.readTableFilter(Parser.java:1866)
at org.h2.command.Parser.readJoin(Parser.java:2295)
at org.h2.command.Parser.parseJoinTableFilter(Parser.java:2655)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2644)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2790)
at org.h2.command.Parser.parseSelectSub(Parser.java:2638)
at org.h2.command.Parser.parseSelectUnion(Parser.java:2471)
at org.h2.command.Parser.parseSelect(Parser.java:2442)
at org.h2.command.Parser.parsePrepared(Parser.java:815)
at org.h2.command.Parser.parse(Parser.java:789)
at org.h2.command.Parser.parse(Parser.java:761)
at org.h2.command.Parser.prepareCommand(Parser.java:684)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 11:56:13 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "select produto.nome, categoria.nome as ""Categoria"", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join produto_loja on produto_loja.produto_id = produto.id
where produto_loja.loja_id = loja.id
where[*] loja.id = 1"; SQL statement:
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join produto_loja on produto_loja.produto_id = produto.id
where produto_loja.loja_id = loja.id
where loja.id = 1 [42000-198]
2021-03-25 11:56:24 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "loja.id" not found; SQL statement:
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join produto_loja on produto_loja.produto_id = produto.id
where produto_loja.loja_id = loja.id
and loja.id = 1 [42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:207)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:133)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-25 12:16:34 jdbc[3]: exception
org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.NullPointerException" [50000-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:194)
at org.h2.message.DbException.convert(DbException.java:347)
at org.h2.message.DbException.toSQLException(DbException.java:319)
at org.h2.message.TraceObject.logAndConvert(TraceObject.java:366)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:100)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException
at org.h2.expression.condition.Comparison.createIndexConditions(Comparison.java:519)
at org.h2.expression.condition.ConditionAndOr.createIndexConditions(ConditionAndOr.java:67)
at org.h2.table.TableFilter.mapAndAddFilter(TableFilter.java:716)
at org.h2.table.TableFilter.addJoin(TableFilter.java:692)
at org.h2.table.TableFilter.addJoin(TableFilter.java:695)
at org.h2.table.TableFilter.addJoin(TableFilter.java:695)
at org.h2.command.Parser.addJoin(Parser.java:2373)
at org.h2.command.Parser.readJoin(Parser.java:2301)
at org.h2.command.Parser.parseJoinTableFilter(Parser.java:2655)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2644)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2790)
at org.h2.command.Parser.parseSelectSub(Parser.java:2638)
at org.h2.command.Parser.parseSelectUnion(Parser.java:2471)
at org.h2.command.Parser.parseSelect(Parser.java:2442)
at org.h2.command.Parser.parsePrepared(Parser.java:815)
at org.h2.command.Parser.parse(Parser.java:789)
at org.h2.command.Parser.parse(Parser.java:761)
at org.h2.command.Parser.prepareCommand(Parser.java:684)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
... 44 more
2021-03-25 12:16:40 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "fe0118fe-967d-49b8-91c5-ae42c287f50b"; SQL statement:
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join produto_loja on produto_loja.produto_id = produto.id
inner join loja on produto_loja.loja_id = loja.uid
and loja.uid = 'fe0118fe-967d-49b8-91c5-ae42c287f50b' [22018-198]

+ 174
- 167
public/scripts/main.js View File

@ -85750,8 +85750,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/lib/tag */ "./node_modules/antd/lib/tag/index.js");
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__);
var _this = undefined;
/* harmony import */ var _utils_Service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/Service */ "./src/utils/Service.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -85768,6 +85767,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var columns = [{
title: "Nome",
dataIndex: "nome"
@ -85779,38 +85779,18 @@ var TabelaCategoria = function TabelaCategoria() {
data = _useState2[0],
setData = _useState2[1];
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
var _fail = function fail() {
_this.setState({
loading: false
});
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100
}
});
};
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
_useState4 = _slicedToArray(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
netuno.service({
url: '/services/categorias',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: function success(response) {
if (response.json) {
setData(response.json);
} else {
_fail();
}
},
fail: function fail() {
_fail();
}
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
_utils_Service__WEBPACK_IMPORTED_MODULE_4__["default"].call({
url: "categorias",
setData: setData,
setLoading: setLoading,
errorTitle: 'Tabela das Categorias',
errorMessage: 'Houve uma falha ao carregar a tabela das categorias...'
});
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_table__WEBPACK_IMPORTED_MODULE_1___default.a, {
@ -85842,6 +85822,9 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var antd_lib_spin__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_spin__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd_lib_typography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/lib/typography */ "./node_modules/antd/lib/typography/index.js");
/* harmony import */ var antd_lib_typography__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd_lib_typography__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _utils_Service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utils/Service */ "./src/utils/Service.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -85859,10 +85842,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var Title = antd_lib_typography__WEBPACK_IMPORTED_MODULE_4___default.a.Title;
var JanelaStock = function JanelaStock(_ref) {
var produto = _ref.produto,
var loja = _ref.loja,
onClose = _ref.onClose;
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
@ -85876,40 +85861,13 @@ var JanelaStock = function JanelaStock(_ref) {
setData = _useState4[1];
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
setLoading(true);
var _fail = function fail() {
setLoading(false);
notification["error"]({
message: 'Lista de Stock',
description: 'Houve uma falha ao carregar a lista de Stock...',
style: {
marginTop: 100
}
});
};
netuno.service({
url: '/services/produtosLoja',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: produto.id
}),
success: function success(response) {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
_fail();
}
},
fail: function fail() {
_fail();
}
_utils_Service__WEBPACK_IMPORTED_MODULE_6__["default"].call({
url: "lojas/produtos",
method: "post",
setData: setData,
setLoading: setLoading,
errorTitle: 'Tabela de Stock',
errorMessage: 'Houve uma falha ao carregar a tabela de Stock...'
});
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_modal__WEBPACK_IMPORTED_MODULE_2___default.a, {
@ -85924,12 +85882,12 @@ var JanelaStock = function JanelaStock(_ref) {
}, loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_spin__WEBPACK_IMPORTED_MODULE_3___default.a, null), data.length > 0 ? data.map(function (item) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Title, {
level: 4
}, item.nome), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Pre\xE7o: ", item.preco, " \u20AC"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Quantidade: ", item.quantidade, " ", item.nome, "s"));
}, item.nome), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Categoria: ", item.categoria), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Pre\xE7o: ", item.preco, " \u20AC"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Quantidade: ", item.quantidade));
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", null, "Sem Stock."));
};
JanelaStock.propTypes = {
produto: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
loja: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
onClose: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired
};
/* harmony default export */ __webpack_exports__["default"] = (JanelaStock);
@ -85949,15 +85907,12 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/table */ "./node_modules/antd/lib/table/index.js");
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/table/Column */ "./node_modules/antd/lib/table/Column.js");
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/lib/tag */ "./node_modules/antd/lib/tag/index.js");
/* harmony import */ var antd_lib_tag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_tag__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/lib/button */ "./node_modules/antd/lib/button/index.js");
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd_lib_button__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _JanelaStock_index_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./JanelaStock/index.jsx */ "./src/components/TabelaLoja/JanelaStock/index.jsx");
var _this = undefined;
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/button */ "./node_modules/antd/lib/button/index.js");
/* harmony import */ var antd_lib_button__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_button__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _JanelaStock_index_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JanelaStock/index.jsx */ "./src/components/TabelaLoja/JanelaStock/index.jsx");
/* harmony import */ var _utils_Service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Service */ "./src/utils/Service.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -85985,41 +85940,21 @@ var TabelaLoja = function TabelaLoja() {
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(null),
_useState4 = _slicedToArray(_useState3, 2),
stock = _useState4[0],
setStock = _useState4[1];
produtosLoja = _useState4[0],
setProdutosLoja = _useState4[1];
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
var _fail = function fail() {
_this.setState({
loading: false
});
notification["error"]({
message: 'Erro',
description: 'Tabela de Lojas com erros...',
style: {
marginTop: 100
}
});
};
var _useState5 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
_useState6 = _slicedToArray(_useState5, 2),
loading = _useState6[0],
setLoading = _useState6[1];
netuno.service({
url: '/services/lojas',
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: function success(response) {
if (response.json) {
setData(response.json);
} else {
_fail();
}
},
fail: function fail() {
_fail();
}
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
_utils_Service__WEBPACK_IMPORTED_MODULE_5__["default"].call({
url: "lojas",
setData: setData,
setLoading: setLoading,
errorTitle: 'Tabela de Pessoas',
errorMessage: 'Houve uma falha ao carregar a tabela das pessoas...'
});
}, []);
var columns = [{
@ -86028,21 +85963,22 @@ var TabelaLoja = function TabelaLoja() {
}, {
title: "Stock de Lojas",
render: function render(text, record, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_button__WEBPACK_IMPORTED_MODULE_4___default.a, {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_button__WEBPACK_IMPORTED_MODULE_2___default.a, {
onClick: function onClick() {
return setStock(record);
return setProdutosLoja(record);
}
}, "Ver Stock"));
}
}];
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, !!stock && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_JanelaStock_index_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], {
produto: stock,
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, !!produtosLoja && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_JanelaStock_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
loja: produtosLoja,
onClose: function onClose() {
return setStock(null);
return setProdutosLoja(null);
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_table__WEBPACK_IMPORTED_MODULE_1___default.a, {
dataSource: data,
columns: columns
columns: columns,
loading: loading
}));
};
@ -86061,12 +85997,13 @@ var TabelaLoja = function TabelaLoja() {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/table */ "./node_modules/antd/lib/table/index.js");
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/table/Column */ "./node_modules/antd/lib/table/Column.js");
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_2__);
var _this = undefined;
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_Service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/Service */ "./src/utils/Service.js");
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/lib/table */ "./node_modules/antd/lib/table/index.js");
/* harmony import */ var antd_lib_table__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/lib/table/Column */ "./node_modules/antd/lib/table/Column.js");
/* harmony import */ var antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd_lib_table_Column__WEBPACK_IMPORTED_MODULE_4__);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -86082,6 +86019,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var columns = [{
title: "Nome",
dataIndex: "nome"
@ -86105,41 +86044,21 @@ var TabelaProduto = function TabelaProduto() {
data = _useState2[0],
setData = _useState2[1];
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
var _fail = function fail() {
_this.setState({
loading: false
});
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100
}
});
};
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
_useState4 = _slicedToArray(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
netuno.service({
url: '/services/produtos',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: function success(response) {
if (response.json) {
setData(response.json);
} else {
_fail();
}
},
fail: function fail() {
_fail();
}
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
_utils_Service__WEBPACK_IMPORTED_MODULE_2__["default"].call({
url: "produtos",
setData: setData,
setLoading: setLoading,
errorTitle: 'Tabela de Pessoas',
errorMessage: 'Houve uma falha ao carregar a tabela das pessoas...'
});
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_table__WEBPACK_IMPORTED_MODULE_1___default.a, {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_table__WEBPACK_IMPORTED_MODULE_3___default.a, {
columns: columns,
dataSource: data
});
@ -86161,12 +86080,14 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DashboardContainer; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_MyButton_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../components/MyButton/index.jsx */ "./src/components/MyButton/index.jsx");
/* harmony import */ var _components_TabelaCategorias_index_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../components/TabelaCategorias/index.jsx */ "./src/components/TabelaCategorias/index.jsx");
/* harmony import */ var _components_TabelaLoja_index_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/TabelaLoja/index.jsx */ "./src/components/TabelaLoja/index.jsx");
/* harmony import */ var _components_TabelaProdutos_index_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/TabelaProdutos/index.jsx */ "./src/components/TabelaProdutos/index.jsx");
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less */ "./src/containers/DashboardContainer/index.less");
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_index_less__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_MyButton_index_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../components/MyButton/index.jsx */ "./src/components/MyButton/index.jsx");
/* harmony import */ var _components_TabelaCategorias_index_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/TabelaCategorias/index.jsx */ "./src/components/TabelaCategorias/index.jsx");
/* harmony import */ var _components_TabelaLoja_index_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/TabelaLoja/index.jsx */ "./src/components/TabelaLoja/index.jsx");
/* harmony import */ var _components_TabelaProdutos_index_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/TabelaProdutos/index.jsx */ "./src/components/TabelaProdutos/index.jsx");
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./index.less */ "./src/containers/DashboardContainer/index.less");
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_index_less__WEBPACK_IMPORTED_MODULE_6__);
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@ -86196,6 +86117,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
var DashboardContainer = /*#__PURE__*/function (_Component) {
_inherits(DashboardContainer, _Component);
@ -86292,15 +86214,13 @@ var DashboardContainer = /*#__PURE__*/function (_Component) {
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: "my-dashboard"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: "my-dashboard__button"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", {
style: styleh1
}, "Lojas"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaLoja_index_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", {
}, "Lojas"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaLoja_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", {
style: styleh1
}, "Produtos"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaProdutos_index_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", {
}, "Produtos"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaProdutos_index_jsx__WEBPACK_IMPORTED_MODULE_5__["default"], null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h1", {
style: styleh1
}, "Categorias"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaCategorias_index_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], null)));
}, "Categorias"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TabelaCategorias_index_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], null));
}
}]);
@ -86417,6 +86337,93 @@ var update = api(content, options);
module.exports = content.locals || {};
/***/ }),
/***/ "./src/utils/Service.js":
/*!******************************!*\
!*** ./src/utils/Service.js ***!
\******************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Service; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/notification */ "./node_modules/antd/lib/notification/index.js");
/* harmony import */ var antd_lib_notification__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd_lib_notification__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd_lib_spin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/lib/spin */ "./node_modules/antd/lib/spin/index.js");
/* harmony import */ var antd_lib_spin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd_lib_spin__WEBPACK_IMPORTED_MODULE_2__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var Service = /*#__PURE__*/function () {
function Service() {
_classCallCheck(this, Service);
}
_createClass(Service, null, [{
key: "spin",
value: function spin(loading) {
return loading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd_lib_spin__WEBPACK_IMPORTED_MODULE_2___default.a, null);
}
}, {
key: "call",
value: function call(settings) {
if (!settings.url || !settings.setData || !settings.setLoading) {
console.error("Service.call", settings);
return;
}
settings.setLoading(true);
var _fail = function fail() {
settings.setLoading(false);
antd_lib_notification__WEBPACK_IMPORTED_MODULE_1___default.a["error"]({
message: settings.errorTitle ? settings.errorTitle : "Erro no Serviço",
description: settings.errorMessage ? settings.errorMessage : settings.url,
style: {
marginTop: 100
}
});
};
netuno.service({
url: "/services/".concat(settings.url),
method: settings.method ? settings.method.toUpperCase() : "GET",
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: settings.body ? settings.body : null,
success: function success(response) {
if (response.json) {
settings.setData(response.json);
settings.setLoading(false);
} else {
_fail();
}
},
fail: function fail() {
_fail();
}
});
}
}]);
return Service;
}();
/***/ }),
/***/ 0:


+ 1
- 1
public/scripts/main.js.map
File diff suppressed because it is too large
View File


server/services/categorias.js → server/services/categorias/get.js View File


server/services/lojas.js → server/services/lojas/get.js View File


+ 10
- 0
server/services/lojas/produtos/post.js View File

@ -0,0 +1,10 @@
const dbProdutosLoja = _db.query(`
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join produto_loja on produto_loja.produto_id = produto.id
inner join loja on produto_loja.loja_id = loja.id
and loja.id = ?
`, _req.getInt("id"))
//java.lang.Thread.sleep(4000)
_out.json(dbProdutosLoja)

server/services/produtos.js → server/services/produtos/get.js View File


+ 0
- 11
server/services/produtosLoja.js View File

@ -1,11 +0,0 @@
const dbProdutosLoja = _db.query(`
select produto.nome, categoria.nome as "Categoria", produto.quantidade, produto.preco from produto
inner join categoria on produto.categoria_id = categoria.id
inner join loja on produto.loja_id = loja.id
where loja.id = ?
`, _req.getInt("id"))
//java.lang.Thread.sleep(4000)
_out.json(
dbProdutosLoja
)

+ 3
- 3
server/setup/_schema-form-3-produto.js View File

@ -65,14 +65,14 @@ _form.createComponentIfNotExists(
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "loja_id")
.set("name", "lojas")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"loja:mercearia\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("properties", "{\"ITEM_SEPARATOR\":{\"default\":\" # \",\"type\":\"STRING\",\"value\":\" # \"},\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"REFERENCE\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"produto_loja:produto_id\"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"produto_loja:loja_id\"},\"SERVICE\":{\"default\":\"com/MultiSelect.netuno\",\"type\":\"STRING\",\"value\":\"com/MultiSelect.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("type", "multiselect")
.set("uid", "1f1846a0-5e40-4cf0-be1a-3c43cc1dd262")
.set("user_id", 0)
.set("whenedit", true)


+ 88
- 0
server/setup/_schema-form-4-produto_loja.js View File

@ -0,0 +1,88 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Loja")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "produto_loja")
.set("parent_uid", "fe5ca7f9-bce2-499d-b821-03208c6d03d1")
.set("report", false)
.set("show_id", true)
.set("uid", "31ca5fc7-1ce2-4d32-b636-f739c833241b")
)
_form.createComponentIfNotExists(
"31ca5fc7-1ce2-4d32-b636-f739c833241b",
_val.init()
.set("colspan", 0)
.set("displayname", "Loja")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "loja_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"loja:mercearia\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "8c5cd2fa-9f9e-439a-ac89-fbe9853b756b")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)
_form.createComponentIfNotExists(
"31ca5fc7-1ce2-4d32-b636-f739c833241b",
_val.init()
.set("colspan", 0)
.set("displayname", "Produto")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "produto_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"produto:nome,quantidade,preco\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "901dc2d9-10fd-4e87-b87a-58241ae992fd")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 2)
)

+ 1
- 0
ui/package.json View File

@ -30,6 +30,7 @@
},
"dependencies": {
"antd": "^4.1.0",
"bizcharts": "^4.1.9",
"chart.js": "^2.9.3",
"react-chartjs-2": "^2.9.0"
}


+ 10
- 33
ui/src/components/TabelaCategorias/index.jsx View File

@ -4,6 +4,8 @@ import Table from 'antd/lib/table';
import Column from "antd/lib/table/Column";
import Tag from "antd/lib/tag";
import Service from "../../utils/Service";
const columns = [
{
@ -15,43 +17,18 @@ const TabelaCategoria = () => {
const [data, setData] = useState([]);
const [ loading, setLoading ] = useState(false);
useEffect(() => {
const fail = () => {
this.setState({ loading: false });
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/categorias',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response) => {
if (response.json) {
setData(response.json);
} else {
fail();
}
},
fail: () => {
fail();
}
Service.call({
url: `categorias`,
setData,
setLoading,
errorTitle: 'Tabela das Categorias',
errorMessage: 'Houve uma falha ao carregar a tabela das categorias...'
});
}, []);
}, [ ]);
return <Table columns={columns} dataSource={data} />
};


+ 19
- 36
ui/src/components/TabelaLoja/JanelaStock/index.jsx View File

@ -1,50 +1,32 @@
import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Modal from 'antd/lib/modal';
import Spin from 'antd/lib/spin';
import Typography from 'antd/lib/typography';
import notification from 'antd/lib/notification';
import Service from "../../../utils/Service";
const { Title } = Typography;
const JanelaStock = ({ produto, onClose }) => {
const JanelaStock = ({ loja, onClose }) => {
const [ loading, setLoading ] = useState(false);
const [ data, setData ] = useState([]);
useEffect(() => {
setLoading(true);
const fail = ()=> {
setLoading(false);
notification["error"]({
message: 'Lista de Stock',
description: 'Houve uma falha ao carregar a lista de Stock...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/produtosLoja',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: produto.id
}),
success: (response)=> {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
Service.call({
url: `lojas/produtos`,
method: "post",
setData,
setLoading,
errorTitle: 'Tabela de Stock',
errorMessage: 'Houve uma falha ao carregar a tabela de Stock...'
});
}, []);
}, [ ]);
return <Modal
title="Stock"
visible={true}
@ -56,8 +38,9 @@ const JanelaStock = ({ produto, onClose }) => {
(item)=> (
<div>
<Title level={4}>{item.nome}</Title>
<p>Categoria: {item.categoria}</p>
<p>Preço: {item.preco} </p>
<p>Quantidade: {item.quantidade} {item.nome}s</p>
<p>Quantidade: {item.quantidade}</p>
</div>
)
@ -67,7 +50,7 @@ const JanelaStock = ({ produto, onClose }) => {
};
JanelaStock.propTypes = {
produto: PropTypes.object.isRequired,
loja: PropTypes.object.isRequired,
onClose: PropTypes.func.isRequired
};


+ 21
- 48
ui/src/components/TabelaLoja/index.jsx View File

@ -1,55 +1,27 @@
import React, { useState, useEffect } from "react";
import Table from 'antd/lib/table';
import Column from "antd/lib/table/Column";
import Tag from "antd/lib/tag";
import Button from 'antd/lib/button';
import JanelaStock from "./JanelaStock/index.jsx";
import notification from 'antd/lib/notification';
import JanelaStock from "./JanelaStock/index.jsx";
import Service from "../../utils/Service";
const TabelaLoja = () => {
const [data, setData] = useState([]);
const [ stock, setStock ] = useState(null);
const [ produtosLoja, setProdutosLoja ] = useState(null);
const [ loading, setLoading ] = useState(false);
useEffect(() => {
const fail = () => {
this.setState({ loading: false });
notification["error"]({
message: 'Erro',
description: 'Tabela de Lojas com erros...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/lojas',
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response) => {
if (response.json) {
setData(response.json);
} else {
fail();
}
},
fail: () => {
fail();
}
Service.call({
url: `lojas`,
setData,
setLoading,
errorTitle: 'Tabela de Pessoas',
errorMessage: 'Houve uma falha ao carregar a tabela das pessoas...'
});
}, []);
}, [ ]);
const columns = [
{
@ -60,7 +32,8 @@ const TabelaLoja = () => {
title: "Stock de Lojas",
render: (text, record, index) => (
<div>
{ <Button onClick={ () => setStock(record) } >Ver Stock</Button>}
{ <Button onClick={ () => setProdutosLoja(record) } >Ver Stock</Button>}
</div>
)
}
@ -70,16 +43,16 @@ const TabelaLoja = () => {
return <>
{ !!stock && <JanelaStock
produto={stock}
onClose={ () => setStock(null) }
{ !!produtosLoja && <JanelaStock
loja={produtosLoja}
onClose={ () => setProdutosLoja(null) }
/> }
<Table dataSource={data} {... { columns}} />
<Table dataSource={data} {... { columns, loading}} />
</>
</>;
};
export default TabelaLoja;

+ 11
- 33
ui/src/components/TabelaProdutos/index.jsx View File

@ -1,10 +1,12 @@
import React, { useState, useEffect } from "react";
import notification from 'antd/lib/notification';
import Service from "../../utils/Service";
import Table from 'antd/lib/table';
import Column from "antd/lib/table/Column";
const columns = [
{
title: "Nome",
@ -32,42 +34,18 @@ const TabelaProduto = () => {
const [data, setData] = useState([]);
const [ loading, setLoading ] = useState(false);
useEffect(() => {
const fail = () => {
this.setState({ loading: false });
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/produtos',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response) => {
if (response.json) {
setData(response.json);
} else {
fail();
}
},
fail: () => {
fail();
}
Service.call({
url: `produtos`,
setData,
setLoading,
errorTitle: 'Tabela de Pessoas',
errorMessage: 'Houve uma falha ao carregar a tabela das pessoas...'
});
}, []);
}, [ ]);
return <Table columns={columns} dataSource={data} />


+ 4
- 3
ui/src/containers/DashboardContainer/index.jsx View File

@ -1,10 +1,12 @@
import React, { Component } from "react";
import notification from 'antd/lib/notification';
import MyButton from "../../components/MyButton/index.jsx";
import TabelaCategoria from "../../components/TabelaCategorias/index.jsx";
import TabelaLoja from "../../components/TabelaLoja/index.jsx";
import TabelaProduto from "../../components/TabelaProdutos/index.jsx";
import "./index.less";
export default class DashboardContainer extends Component {
@ -90,15 +92,14 @@ export default class DashboardContainer extends Component {
}
return (
<div className="my-dashboard">
<div className="my-dashboard__button">
<h1 style={styleh1}>Lojas</h1>
<TabelaLoja/>
<h1 style={styleh1}>Produtos</h1>
<TabelaProduto/>
<h1 style={styleh1}>Categorias</h1>
<TabelaCategoria/>
{/* <MyButton mainRef={ this.button } text={ `ReactJS ⚡ Ant.Design 👉 Click me! ${ counter }` } click={ this.click } /> */}
</div>
{/* <MyButton mainRef={ this.button } text={ `ReactJS ⚡ Ant.Design 👉 Click me! ${ counter }` } click={ this.click } /> */}
</div>
);
}


+ 47
- 0
ui/src/utils/Service.js View File

@ -0,0 +1,47 @@
import React from "react";
import notification from 'antd/lib/notification';
import Spin from 'antd/lib/spin';
export default class Service {
static spin(loading) {
return loading && <Spin />;
}
static call(settings) {
if (!settings.url || !settings.setData || !settings.setLoading) {
console.error("Service.call", settings);
return;
}
settings.setLoading(true);
const fail = ()=> {
settings.setLoading(false);
notification["error"]({
message: settings.errorTitle ? settings.errorTitle : "Erro no Serviço",
description: settings.errorMessage ? settings.errorMessage : settings.url,
style: {
marginTop: 100,
}
});
};
netuno.service({
url: `/services/${settings.url}`,
method: settings.method ? settings.method.toUpperCase() : "GET",
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: settings.body ? settings.body : null,
success: (response)=> {
if (response.json) {
settings.setData(response.json);
settings.setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
}
}

Loading…
Cancel
Save