Commit 6067a0b5 by 李小惠

修改OAbug

parent 854ca8d5
......@@ -4,13 +4,13 @@
<data-source source="LOCAL" name="junmp" uuid="ce8e9dd8-fc56-41f7-9a8b-6cbd906018c3">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://192.168.3.128:3306/db_jyzb?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://192.168.1.128:3306/db_jyzb?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
</data-source>
<data-source source="LOCAL" name="local" uuid="134b9a70-dbff-479c-9337-8e4869b6525e">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://127.0.0.1:3306/junmp?characterEncoding=UTF-8&amp;useUnicode=true&amp;useSSL=false&amp;tinyInt1isBit=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=Asia/Shanghai</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
......
......@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/lxh" vcs="Git" />
</component>
</project>
\ No newline at end of file
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-11] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.017 ERROR 14020 --- [http-nio-10030-exec-14] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-5] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-1] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-4] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-13] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.016 ERROR 14020 --- [http-nio-10030-exec-10] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.043 ERROR 14020 --- [http-nio-10030-exec-17] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.046 ERROR 14020 --- [http-nio-10030-exec-12] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.046 ERROR 14020 --- [http-nio-10030-exec-3] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.047 ERROR 14020 --- [http-nio-10030-exec-2] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-11 08:46:24.391 ERROR 14020 --- [http-nio-10030-exec-8] c.j.v2.ws.channel.WsSessionContainer : 数据推送异常>>java.io.IOException: 您的主机中的软件中止了一个已建立的连接。
2024-03-11 08:46:44.894 ERROR 14020 --- [flowable-bpmn-acquire-timer-jobs] o.s.jdbc.support.JdbcTransactionManager : Commit exception overridden by rollback exception
2024-03-14 00:58:37.547 ERROR 17052 --- [http-nio-10030-exec-2] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-14 01:11:44.622 ERROR 18904 --- [main] easy-es : Easy-Es supported elasticsearch and restHighLevelClient jar version is:7.14.0 ,Please resolve the dependency conflict!
2024-03-14 01:12:08.503 ERROR 18904 --- [http-nio-10030-exec-1] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-14 01:21:51.288 ERROR 18904 --- [http-nio-10030-exec-5] c.j.j.b.c.handle.GlobalExceptionHandler : 业务异常,错误信息为:ywydnb 用户不存在
2024-03-14 01:24:39.192 ERROR 18904 --- [http-nio-10030-exec-7] c.j.j.b.c.handle.GlobalExceptionHandler : 服务器运行异常
org.springframework.dao.RecoverableDataAccessException: JDBC commit; The last packet successfully received from the server was 71,159,066 milliseconds ago. The last packet sent successfully to the server was 71,159,922 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,159,066 milliseconds ago. The last packet sent successfully to the server was 71,159,922 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100)
org.springframework.dao.DataIntegrityViolationException: com.junmp.jyzb.mapper.WarehouseInventoryMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Field 'location_state' doesn't have a default value
; Field 'location_state' doesn't have a default value; nested exception is java.sql.BatchUpdateException: Field 'location_state' doesn't have a default value
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:251)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.support.JdbcTransactionManager.translateException(JdbcTransactionManager.java:184)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:336)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:152)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.job.service.impl.asyncexecutor.AcquireTimerJobsRunnable.executeAcquireAndMoveCycle(AcquireTimerJobsRunnable.java:178)
at org.flowable.job.service.impl.asyncexecutor.AcquireTimerJobsRunnable.run(AcquireTimerJobsRunnable.java:119)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,159,066 milliseconds ago. The last packet sent successfully to the server was 71,159,922 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
at com.mysql.cj.jdbc.ConnectionImpl.commit(ConnectionImpl.java:814)
at com.zaxxer.hikari.pool.ProxyConnection.commit(ProxyConnection.java:387)
at com.zaxxer.hikari.pool.HikariProxyConnection.commit(HikariProxyConnection.java)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:333)
... 10 common frames omitted
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 71,159,066 milliseconds ago. The last packet sent successfully to the server was 71,159,922 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:569)
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:624)
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:940)
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryString(NativeProtocol.java:886)
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:1073)
at com.mysql.cj.jdbc.ConnectionImpl.commit(ConnectionImpl.java:802)
... 13 common frames omitted
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55)
at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:560)
... 18 common frames omitted
2024-03-11 08:46:44.894 ERROR 14020 --- [flowable-bpmn-acquire-async-jobs] o.s.jdbc.support.JdbcTransactionManager : Commit exception overridden by rollback exception
org.springframework.dao.RecoverableDataAccessException: JDBC commit; The last packet successfully received from the server was 71,159,064 milliseconds ago. The last packet sent successfully to the server was 71,159,919 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,159,064 milliseconds ago. The last packet sent successfully to the server was 71,159,919 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.support.JdbcTransactionManager.translateException(JdbcTransactionManager.java:184)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:336)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:152)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.job.service.impl.asyncexecutor.AcquireAsyncJobsDueRunnable.acquireAndExecuteJobs(AcquireAsyncJobsDueRunnable.java:182)
at org.flowable.job.service.impl.asyncexecutor.AcquireAsyncJobsDueRunnable.executeAcquireCycle(AcquireAsyncJobsDueRunnable.java:156)
at org.flowable.job.service.impl.asyncexecutor.AcquireAsyncJobsDueRunnable.run(AcquireAsyncJobsDueRunnable.java:134)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,159,064 milliseconds ago. The last packet sent successfully to the server was 71,159,919 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
at com.mysql.cj.jdbc.ConnectionImpl.commit(ConnectionImpl.java:814)
at com.zaxxer.hikari.pool.ProxyConnection.commit(ProxyConnection.java:387)
at com.zaxxer.hikari.pool.HikariProxyConnection.commit(HikariProxyConnection.java)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:333)
... 11 common frames omitted
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 71,159,064 milliseconds ago. The last packet sent successfully to the server was 71,159,919 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:569)
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:624)
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:940)
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryString(NativeProtocol.java:886)
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:1073)
at com.mysql.cj.jdbc.ConnectionImpl.commit(ConnectionImpl.java:802)
... 14 common frames omitted
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55)
at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:560)
... 19 common frames omitted
2024-03-11 08:46:44.894 ERROR 14020 --- [http-nio-10030-exec-9] o.s.t.i.TransactionInterceptor : Application exception overridden by rollback exception
org.springframework.dao.RecoverableDataAccessException:
### Error querying database. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
### The error may exist in file [F:\vue_project\jyzb_platformV2_localhost\jyzb-biz\target\classes\mapper\InventorySummaryMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type, number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price, broken_price,broken_number,fix_price,fix_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property from base_inventory_summary where ( org_id_int = 1369509498032811869 AND location_id = '1f1d8183-da63-4125-87b6-80ff382ca5e0' AND type_id = 4101016 AND size_id = '3b2a8c80-4f9a-40e4-ac66-5bcaae7c8d4e' AND unit_price = 2803 and property= ) or ( org_id_int = 1369509498032811869 AND location_id = '1f1d8183-da63-4125-87b6-80ff382ca5e0' AND type_id = 4101016 AND size_id = '3b2a8c80-4f9a-40e4-ac66-5bcaae7c8d4e' AND unit_price = 280 and property= )
### Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
; The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy142.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy280.selectSum(Unknown Source)
at com.junmp.jyzb.service.impl.InventoryServiceImpl.BatchEditingInvsInfo(InventoryServiceImpl.java:376)
at com.baomidou.mybatisplus.extension.toolkit.SqlHelper.executeBatch(SqlHelper.java:192)
at com.baomidou.mybatisplus.extension.toolkit.SqlHelper.executeBatch(SqlHelper.java:217)
at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.executeBatch(ServiceImpl.java:240)
at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.saveBatch(ServiceImpl.java:136)
at com.baomidou.mybatisplus.extension.service.IService.saveBatch(IService.java:73)
at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.junmp.jyzb.service.impl.WarehouseInventoryServiceImpl$$EnhancerBySpringCGLIB$$f05628b9.saveBatch(<generated>)
at com.junmp.jyzb.service.impl.InventoryServiceImpl.EqsImport(InventoryServiceImpl.java:736)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$FastClassBySpringCGLIB$$43c51e0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
......@@ -151,8 +38,8 @@ org.springframework.dao.RecoverableDataAccessException:
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$EnhancerBySpringCGLIB$$3b09c15d.BatchEditingInvsInfo(<generated>)
at com.junmp.jyzb.controller.InventoryController.BatchEditingInvsInfo(InventoryController.java:247)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$EnhancerBySpringCGLIB$$3276b7c2.EqsImport(<generated>)
at com.junmp.jyzb.controller.InventoryController.EqsImport(InventoryController.java:299)
at com.junmp.jyzb.controller.InventoryController$$FastClassBySpringCGLIB$$afea5808.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
......@@ -160,7 +47,7 @@ org.springframework.dao.RecoverableDataAccessException:
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at com.junmp.v2.log.aop.ApiLogRecordAop.aroundPost(ApiLogRecordAop.java:66)
at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor393.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
......@@ -172,7 +59,7 @@ org.springframework.dao.RecoverableDataAccessException:
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.junmp.jyzb.controller.InventoryController$$EnhancerBySpringCGLIB$$5f668ef5.BatchEditingInvsInfo(<generated>)
at com.junmp.jyzb.controller.InventoryController$$EnhancerBySpringCGLIB$$3e7ded72.EqsImport(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
......@@ -233,164 +120,40 @@ org.springframework.dao.RecoverableDataAccessException:
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at sun.reflect.GeneratedMethodAccessor212.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64)
at com.sun.proxy.$Proxy354.query(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
at com.sun.proxy.$Proxy353.query(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at sun.reflect.GeneratedMethodAccessor271.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 101 common frames omitted
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 71,174,562 milliseconds ago. The last packet sent successfully to the server was 71,174,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Caused by: java.sql.BatchUpdateException: Field 'location_state' doesn't have a default value
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:569)
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:624)
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:940)
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:1075)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:930)
... 125 common frames omitted
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55)
at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50)
at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:560)
... 129 common frames omitted
2024-03-11 08:46:44.898 ERROR 14020 --- [http-nio-10030-exec-9] c.j.j.b.c.handle.GlobalExceptionHandler : 服务器运行异常
org.springframework.transaction.TransactionSystemException: JDBC rollback failed; nested exception is java.sql.SQLException: Connection is closed
at org.springframework.jdbc.datasource.DataSourceTransactionManager.translateException(DataSourceTransactionManager.java:435)
at org.springframework.jdbc.support.JdbcTransactionManager.translateException(JdbcTransactionManager.java:188)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:351)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:835)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:809)
at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:672)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:392)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$EnhancerBySpringCGLIB$$3b09c15d.BatchEditingInvsInfo(<generated>)
at com.junmp.jyzb.controller.InventoryController.BatchEditingInvsInfo(InventoryController.java:247)
at com.junmp.jyzb.controller.InventoryController$$FastClassBySpringCGLIB$$afea5808.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at com.junmp.v2.log.aop.ApiLogRecordAop.aroundPost(ApiLogRecordAop.java:66)
at sun.reflect.GeneratedMethodAccessor284.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.junmp.jyzb.controller.InventoryController$$EnhancerBySpringCGLIB$$5f668ef5.BatchEditingInvsInfo(<generated>)
at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
at com.mysql.cj.util.Util.getInstance(Util.java:167)
at com.mysql.cj.util.Util.getInstance(Util.java:174)
at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:853)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:435)
at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:796)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:123)
at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129)
at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122)
at org.apache.ibatis.executor.CachingExecutor.flushStatements(CachingExecutor.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.junmp.v2.security.xss.XssFilter.doFilter(XssFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:515)
at com.sun.proxy.$Proxy255.rollback(Unknown Source)
at com.zaxxer.hikari.pool.ProxyConnection.rollback(ProxyConnection.java:396)
at com.zaxxer.hikari.pool.HikariProxyConnection.rollback(HikariProxyConnection.java)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:348)
... 90 common frames omitted
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64)
at com.sun.proxy.$Proxy354.flushStatements(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:249)
at com.baomidou.mybatisplus.extension.toolkit.SqlHelper.lambda$executeBatch$1(SqlHelper.java:224)
at com.baomidou.mybatisplus.extension.toolkit.SqlHelper.executeBatch(SqlHelper.java:182)
... 110 common frames omitted
Caused by: java.sql.SQLException: Field 'location_state' doesn't have a default value
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:832)
... 127 common frames omitted
2024-03-11 08:47:16.810 ERROR 14020 --- [http-nio-10030-exec-16] c.j.j.b.c.handle.GlobalExceptionHandler : 业务异常,错误信息为:nbyw 用户不存在
2024-03-11 10:31:42.473 ERROR 14020 --- [http-nio-10030-exec-16] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,12 +2,14 @@ package com.junmp.jyzb.api.bean.dto;
import lombok.Data;
import java.util.Date;
@Data
public class DetailChildDto {
private String totalPrice;
private String warrantyPeriod;
private String maintenancePeriod;
private String productionDate;
private Date productionDate;
private String num;
private String price;
}
package com.junmp.jyzb.api.bean.query;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
......@@ -44,4 +45,6 @@ public class BussinessOrderDetialReq {
//报废区数
private Integer brokenNumber;
private Integer property;
private Integer expireNumber;
}
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.cache;
import com.junmp.jyzb.api.constant.JYZBConstant;
import com.junmp.jyzb.entity.Temp.HumidityAndtemperature;
import com.junmp.v2.cache.AbstractRedisCache;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
......@@ -33,21 +34,24 @@ public class TemperatureRedisCache extends AbstractRedisCache<Object> {
// String key = warehouseId;
// Long size = getRedisTemplate().opsForZSet().size(key);
getRedisTemplate().opsForZSet().add("WarehouseDev:"+warehouseId, data, timestamp);
setValueWithExpiration("WarehouseDev:"+warehouseId, data,259200);
getRedisTemplate().opsForValue().getOperations().expire("WarehouseDev:" + warehouseId, 259200, TimeUnit.SECONDS);
put(warehouseId, data);
}
public List<Object> getDataByTimestampRange(String warehouseId, long startTimestamp, long endTimestamp) {
// String key = warehouseId;
// boolean exists = getRedisTemplate().hasKey(key);
boolean exists = getRedisTemplate().hasKey("WarehouseDev:"+warehouseId);
DataType keyType = getRedisTemplate().type("WarehouseDev:"+warehouseId);
// Long size = getRedisTemplate().opsForZSet().size(key);
Set<Object> dataInRange = getRedisTemplate().opsForZSet().rangeByScore("WarehouseDev:"+warehouseId, startTimestamp, endTimestamp);
// getRedisTemplate().opsForZSet().rangeByScoreWithScores(key, startTimestamp, endTimestamp)
// Set<Object> dataInRange1= getRedisTemplate().opsForZSet ().reverseRange(key, startTimestamp, endTimestamp);
return new ArrayList<>(dataInRange);
}
public void setValueWithExpiration(String key, HumidityAndtemperature value, long expirationSeconds) {
getRedisTemplate().opsForValue().set(key, value, expirationSeconds, TimeUnit.SECONDS);
}
// public void setValueWithExpiration(String key, HumidityAndtemperature value, long expirationSeconds) {
// getRedisTemplate().opsForValue().set(key, value, expirationSeconds, TimeUnit.SECONDS);
// }
}
......@@ -57,7 +57,6 @@ public class CrudController {
@PostMapping("/UpdateES")
public Object UpdateES() {
pubOrgService.AddToEs();
equipmentTypeService.addEs();
equipmentSizeService.addEs();
busFormService.addEs();
......
......@@ -320,10 +320,6 @@ public class PoliceController {
return ApiRes.success(policemanService.alignUserInfo(req));
}
// @PostMapping(path = "/oneClickAccountCreation",name = "一键生成账号(运维,管理,审核)#logType=30")
// public ApiRes<Boolean> oneClickAccountCreation(@RequestBody PubOrg pubOrg) throws IOException {
// return ApiRes.success(policemanService.oneClickAccountCreation(pubOrg));
// }
@PostMapping(path = "/oneClickAccountCreation",name = "一键生成账号(运维,管理,审核)#logType=30")
@ApiOperation("一键生成账号")
public ApiRes<Boolean> oneClickAccountCreation(@RequestBody PubOrg pubOrg) throws IOException {
......
......@@ -102,6 +102,8 @@ public class PublicController {
@Resource
private OrderMainService orderMainService;
@Resource
private PubOrgService pubOrgService;
@Resource
private OutInRecordRedisCache outInRecordRedisCache;
......@@ -159,11 +161,6 @@ public class PublicController {
return ApiRes.success(publicService.updateMessage(req));
}
@PostMapping(path = "/setReadMessage",name = "将消息设置为已读状态#logType=30")
@ApiOperation("将消息设置为已读状态")
public ApiRes<Boolean> setReadMessage(@RequestBody MessageReq req){
return ApiRes.success(publicService.setReadMessage(req));
}
@PostMapping("/aaa")
......@@ -194,6 +191,12 @@ public class PublicController {
return ApiRes.success(true);
}
@PostMapping(path = "/findCodeToOrgId",name = "通过区域短码获取组织机构id#logType=30")
@ApiOperation("通过区域短码获取组织机构id")
public ApiRes<Long> findCodeToOrgId(@RequestBody PubOrg pubOrg){
return ApiRes.success(pubOrgService.findCodeToOrgId(pubOrg));
}
}
......@@ -41,7 +41,7 @@ public class VieDestoryGroup implements Serializable {
private String orgId;
@TableField("count_of_items")
private String countOfItems;
private Integer countOfItems;
@TableField("warehouse_id")
private String warehouseId;
......
......@@ -42,7 +42,7 @@ public class VieWarrantyGroup implements Serializable {
private String orgId;
@TableField("count_of_items")
private String countOfItems;
private Integer countOfItems;
@TableField("warehouse_id")
private String warehouseId;
......
......@@ -113,6 +113,8 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
void updateEqsInfo(@Param("list") List<InventoryReq> addInvList,@Param("updateTime") Date time);
List<Inventory> selectSum(@Param("list") List<Object[]> searchItem,@Param("epcType")Integer epcType);
// IPage<InventoryDto> GetDetailByTerms(@Param("page") Page<Object> defaultPage, @Param("req") InventoryReq req);
......
......@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.VieDestoryGroup;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface VieDestroyGroupMapper extends BaseMapper<VieDestoryGroup> {
List<VieDestoryGroup> selectByTerms(@Param("list") List<VieWarrantyGroup> valuesList);
}
\ No newline at end of file
......@@ -22,4 +22,5 @@ import java.util.Map;
@Mapper
public interface VieWarrantyGroupMapper extends BaseMapper<VieWarrantyGroup> {
List<VieWarrantyGroup> selectByTerms(@Param("list") List<VieWarrantyGroup> valuesList);
}
\ No newline at end of file
......@@ -94,4 +94,5 @@ public interface InventoryService extends IService<Inventory> {
List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req);
List<Inventory> selectSum(List<Object[]> searchItem,Integer epctype);
}
......@@ -44,4 +44,6 @@ public interface PubOrgService extends IService<PubOrg> {
boolean updatePubOrg(UpdateOrgReq req);
PubOrg getOneOrgInfo(UpdateOrgReq req);
Long findCodeToOrgId(PubOrg pubOrg);
}
......@@ -18,5 +18,4 @@ public interface PublicService {
boolean updateMessage(MessageReq req);
boolean setReadMessage(MessageReq req);
}
......@@ -6,8 +6,12 @@ import com.junmp.jyzb.api.bean.req.WarrantyReq;
import com.junmp.jyzb.entity.VieDestoryGroup;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import com.junmp.v2.db.api.page.PageResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VieDestoryGroupService extends IService<VieDestoryGroup> {
}
\ No newline at end of file
......@@ -5,8 +5,13 @@ import com.junmp.jyzb.api.bean.dto.TjDto.WarrantyDataDto;
import com.junmp.jyzb.api.bean.req.WarrantyReq;
import com.junmp.jyzb.entity.VieWarrantyGroup;
import com.junmp.v2.db.api.page.PageResult;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VieWarrantyGroupService extends IService<VieWarrantyGroup> {
PageResult<WarrantyDataDto> WarrantyData(WarrantyReq req);
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -16,6 +17,7 @@ import com.junmp.junmpProcess.service.IFlowInstanceService;
import com.junmp.jyzb.Repository.BusFormRepository;
import com.junmp.jyzb.api.bean.dto.BusFormDto;
import com.junmp.jyzb.api.bean.query.BussinessOrderDetialReq;
import com.junmp.jyzb.api.bean.query.InventoryReq;
import com.junmp.jyzb.api.bean.query.QueryBusFormReq;
import com.junmp.jyzb.api.bean.req.UpdateBusFormReq;
import com.junmp.jyzb.api.exception.JYZBAppException;
......@@ -25,6 +27,8 @@ import com.junmp.jyzb.api.exception.enums.OrgExceptionEnum;
import com.junmp.jyzb.cache.MsgRedisCache;
import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.mapper.InventorySummaryMapper;
import com.junmp.jyzb.mapper.VieDestroyGroupMapper;
import com.junmp.jyzb.mapper.VieWarrantyGroupMapper;
import com.junmp.jyzb.service.*;
import com.junmp.jyzb.mapper.BusFormMapper;
import com.junmp.jyzb.utils.BusinessUtil;
......@@ -32,6 +36,7 @@ import com.junmp.jyzb.utils.DateTimeUtil;
import com.junmp.v2.auth.api.bean.login.LoginUser;
import com.junmp.v2.auth.api.context.LoginContext;
import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult;
......@@ -46,8 +51,10 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.management.remote.rmi._RMIConnection_Stub;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author lxh专属坐骑
......@@ -90,6 +97,20 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
@Resource
private PolicemanService policemanService;
@Resource
private LogSummaryService logSummaryService;
@Resource
private VieDestroyGroupMapper vieDestroyGroupMapper;
@Resource
private VieWarrantyGroupMapper vieWarrantyGroupMapper;
@Resource
private VieWarrantyGroupService vieWarrantyGroupService;
@Resource
private VieDestoryGroupService vieDestoryGroupService;
public Object addEs() {
List<BusForm> esDto=this.list();
return busFormRepository.saveAll(esDto);
......@@ -489,49 +510,54 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
public boolean updateBrokenResult(BusForm busForm) {
//获取数量
String detailList = busForm.getDetailList();
List<BussinessOrderDetialReq> list = JSON.parseArray(detailList, BussinessOrderDetialReq.class);
List<BussinessOrderDetialReq> list = JSONArray.parseArray(detailList, BussinessOrderDetialReq.class);
//更新inventory表的表达式
LambdaUpdateWrapper<Inventory> updateStateWrapper = Wrappers.lambdaUpdate();
List<Object[]> searchItem=new ArrayList<>();
for (BussinessOrderDetialReq detialReq:list) {
//我先去数据库查询summary表中的数据
Object[] item=new Object[]{busForm.getOrgId(),detialReq.getLocationId(),detialReq.getTypeId(),detialReq.getSizeId(),detialReq.getPrice()};
Object[] item=new Object[]{busForm.getOrgId(),detialReq.getLocationId(),detialReq.getTypeId(),detialReq.getSizeId(),detialReq.getPrice(),detialReq.getProperty()};
searchItem.add(item);
}
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
//实体物资
List<Inventory> inventorySTList=inventoryService.selectSum(searchItem,0);
//虚拟物资
List<Inventory> inventoryXNList=inventoryService.selectSum(searchItem,1);
List<Inventory> updateInvList=new ArrayList<>();
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSum(searchItem);
List<InventorySummary> updateSummaryList=new ArrayList<>();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("组织机构为:"+busForm.getOrgId()+"单号为:"+busForm.getBussinessCode()+"的报废业务单将报废数量进行修改:");
boolean a=false;
//加入map
Map<String,VieWarrantyGroup> map=new HashMap<>();
for (BussinessOrderDetialReq detialReq:list) {
Integer oldPlanNum = detialReq.getPlanNum();
for (InventorySummary is:inventorySummaryList) {
if (detialReq.getLocationId().equals(is.getLocationId()) && detialReq.getTypeId().equals(is.getTypeId())
&& detialReq.getSizeId().equals(is.getSizeId()) && detialReq.getPrice().compareTo(is.getUnitPrice())==0){
&& detialReq.getSizeId().equals(is.getSizeId()) && detialReq.getPrice().compareTo(is.getUnitPrice())==0
&& detialReq.getProperty()==is.getProperty()){
//如果数量相同则直接将全部在库数的装备表中的该仓库的装备状态全部设置为报废,并且修改库存汇总表中的数据
if (detialReq.getPlanNum()+is.getBrokenNumber()==is.getStockNumber()){
a=true;
//修改装备状态表达式
updateStateWrapper.or().eq(Inventory::getOrgId, busForm.getOrgId())
.eq(Inventory::getLocationId, detialReq.getLocationId())
.eq(Inventory::getTypeId, detialReq.getTypeId())
.eq(Inventory::getSizeId, detialReq.getSizeId())
.eq(Inventory::getPrice, detialReq.getPrice())
.eq(Inventory::getLocationType,1)
.eq(Inventory::getLocationState,"in")
.set(Inventory::getState, "broken");
if (detialReq.getPlanNum()==is.getExpireNumber()){
//将库存的报废数量根据单据重新进行计算
Integer brokenNum=detialReq.getPlanNum()+is.getBrokenNumber();
stringBuilder.append("装备为"+detialReq.getTypeName()+","+detialReq.getSizeName()+"的报废数量从"+is.getBrokenNumber()+"改成"+brokenNum+",");
is.setBrokenNumber(brokenNum);
is.setExpireNumber(0);
is.setExpireNumberPrice(BigDecimal.ZERO);
is.setBrokenNumberPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(brokenNum)));
updateSummaryList.add(is);
} else if (detialReq.getPlanNum()+detialReq.getBrokenNumber()<detialReq.getStockNumber()){
} else if (detialReq.getPlanNum()<is.getExpireNumber()){
//如果数量不相等,状态不进行修改,只修改库存汇总表中的信息
//将库存的报废数量根据单据重新进行计算
Integer brokenNum=detialReq.getPlanNum()+is.getBrokenNumber();
stringBuilder.append("装备为"+detialReq.getTypeName()+","+detialReq.getSizeName()+"的报废数量从"+is.getBrokenNumber()+"改成"+brokenNum+",");
is.setBrokenNumber(brokenNum);
is.setBrokenNumberPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(brokenNum)));
is.setExpireNumber(is.getExpireNumber()-detialReq.getPlanNum());
is.setExpireNumberPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getExpireNumber())));
updateSummaryList.add(is);
}else {
throw new ServiceException(InventoryExceptionEnum.INVENTORY_BEYOND_STOCK);
......@@ -540,16 +566,96 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
}
}
for (Inventory inv:inventoryXNList) {
if (detialReq.getPlanNum()>0){
if (detialReq.getLocationId().equals(inv.getLocationId()) && detialReq.getTypeId().equals(inv.getTypeId())
&& detialReq.getSizeId().equals(inv.getSizeId()) && detialReq.getPrice().compareTo(inv.getPrice())==0
&& detialReq.getProperty()==inv.getProperty()){
detialReq.setPlanNum(Math.max(detialReq.getPlanNum()-1,0));
inv.setState("broken");
updateInvList.add(inv);
}
}
}
for (Inventory inv:inventorySTList) {
if (detialReq.getPlanNum()>0){
if (detialReq.getLocationId().equals(inv.getLocationId()) && detialReq.getTypeId().equals(inv.getTypeId())
&& detialReq.getSizeId().equals(inv.getSizeId()) && detialReq.getPrice().compareTo(inv.getPrice())==0
&& detialReq.getProperty()==inv.getProperty()){
detialReq.setPlanNum(Math.max(detialReq.getPlanNum()-1,0));
inv.setState("broken");
updateInvList.add(inv);
}
}
}
String key=detialReq.getOrgId()+ detialReq.getLocationId()+detialReq.getTypeId()+detialReq.getSizeId();
if (map.containsKey(key)){
VieWarrantyGroup vieWarrantyGroup = map.get(key);
vieWarrantyGroup.setCountOfItems(vieWarrantyGroup.getCountOfItems()+oldPlanNum);
map.put(key,vieWarrantyGroup);
}else {
VieWarrantyGroup vieWarrantyGroup = new VieWarrantyGroup();
vieWarrantyGroup.setSizeId(detialReq.getSizeId());
vieWarrantyGroup.setSizeName(detialReq.getSizeName());
vieWarrantyGroup.setTypeId(detialReq.getTypeId());
vieWarrantyGroup.setTypeName(detialReq.getTypeName());
vieWarrantyGroup.setOrgName(detialReq.getOrgName());
vieWarrantyGroup.setOrgId(detialReq.getOrgId().toString());
vieWarrantyGroup.setCountOfItems(oldPlanNum);
vieWarrantyGroup.setWarehouseId(detialReq.getLocationId());
vieWarrantyGroup.setWarehouseName(detialReq.getLocationName());
map.put(key,vieWarrantyGroup);
}
}
//更新过质保期表以及更新报废数表
//通过map查询出过质保期和报废数的数据,过质保的数据 进行删除,报废的数据 (判断是否存在,如果不存在进行新增)
List<VieWarrantyGroup> valuesList = new ArrayList<>(map.values());
List<VieDestoryGroup> brokenList=vieDestroyGroupMapper.selectByTerms(valuesList);
List<VieWarrantyGroup> warrantyList=vieWarrantyGroupMapper.selectByTerms(valuesList);
List<VieDestoryGroup> addList=new ArrayList<>();
for (VieWarrantyGroup invSum:valuesList) {
boolean brokenFlag=false;
for (VieDestoryGroup brokenInv:brokenList) {
if (invSum.getWarehouseId().equals(brokenInv.getWarehouseId()) && invSum.getTypeId().equals(brokenInv.getTypeId())
&& invSum.getSizeId().equals(brokenInv.getSizeId()) && invSum.getOrgId().equals(brokenInv.getOrgId())){
brokenInv.setCountOfItems(brokenInv.getCountOfItems()+invSum.getCountOfItems());
brokenFlag=true;
break;
}
}
if (!brokenFlag){
VieDestoryGroup vieDestoryGroup = new VieDestoryGroup();
BeanPlusUtil.copyProperties(invSum,vieDestoryGroup);
vieDestoryGroup.setCountOfItems(invSum.getCountOfItems());
vieDestoryGroup.setState("broken");
addList.add(vieDestoryGroup);
}
for (VieWarrantyGroup warrantyInv:warrantyList) {
if (invSum.getWarehouseId().equals(warrantyInv.getWarehouseId()) && invSum.getTypeId().equals(warrantyInv.getTypeId())
&& invSum.getSizeId().equals(warrantyInv.getSizeId()) && invSum.getOrgId().equals(warrantyInv.getOrgId())){
warrantyInv.setCountOfItems(warrantyInv.getCountOfItems()-invSum.getCountOfItems());
break;
}
}
}
boolean b=true;
//改inventory表中的装备状态
if (a){
b=inventoryService.update(updateStateWrapper);
inventoryService.updateBatchById(updateInvList);
vieWarrantyGroupService.updateBatchById(warrantyList);
vieDestoryGroupService.updateBatchById(brokenList);
if (CollectionUtil.isNotEmpty(addList)){
vieDestoryGroupService.saveBatch(addList);
}
//批量修改inventtorySummary表中的数据
boolean c=true;
if (updateSummaryList.size()>0){
c=inventorySummaryService.updateBatchById(updateSummaryList);
inventorySummaryService.updateBatchById(updateSummaryList);
}
//创建log记录日志
String string = stringBuilder.toString();
......@@ -563,8 +669,14 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
orderLog.setOrgName(busForm.getOrgName());
orderLog.setCreateTime(DateTimeUtil.getCurrentDateTime());
orderLogService.save(orderLog);
return (b && c);
//记录logSummary和logDetail的数据。
List<InventoryReq> collect = updateInvList.stream().map(inventory -> {
InventoryReq inventoryReq = new InventoryReq();
BeanPlusUtil.copyProperties(inventory, inventoryReq);
return inventoryReq;
}).collect(Collectors.toList());
logSummaryService.addLogSummaryByInv(collect,busForm.getId(),busForm.getBussinessCode(),busForm.getBussinessType(),4);
return true;
}
......
......@@ -341,8 +341,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
boolean flag=false;
InventoryReq inv = map.get(key);
for (InventorySummary is:inventorySummaryList) {
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getOriginalPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId())){
if (is.getUnitPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
req.getOriginalPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
inv.getLocationId().equals(is.getLocationId())){
is.setStockNumber(is.getStockNumber()-inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()-inv.getOutBoundNum());
......@@ -356,8 +357,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
break;
}
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId()))
if (is.getUnitPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
req.getPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) &&
inv.getLocationId().equals(is.getLocationId()))
{
is.setStockNumber(is.getStockNumber()+inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()+inv.getOutBoundNum());
......@@ -715,6 +717,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
inventory.setNote("equipmentImport");
inventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
inventory.setEpc(epc);
inventory.setLocationState("in");
inventory.setBussinessState("normal");
inventory.setState("normal");
inventory.setLocationState("in");
addInvList.add(inventory);
WarehouseInventory warehouseInventory = new WarehouseInventory();
BeanPlusUtil.copyProperties(inv,warehouseInventory);
......@@ -723,6 +729,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
warehouseInventory.setFlag(2);
warehouseInventory.setEpc(epc);
warehouseInventory.setOrgName(inv.getOrgName());
warehouseInventory.setLocationState("in");
addWareList.add(warehouseInventory);
}
......@@ -761,5 +768,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return list;
}
@Override
public List<Inventory> selectSum(List<Object[]> searchItem,Integer epcType) {
return inventoryMapper.selectSum(searchItem,epcType);
}
}
\ No newline at end of file
......@@ -769,7 +769,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
Map<String,LogSummaryReq> logMap=new HashMap<>();
for (InventoryReq inv:list) {
logMap=setLogSummaryToMap(logMap,loginUser,inv.getLocationId(),inv.getBussinessType(),inv.getTypeName(),
inv.getLocationName(),orderId,orderCode,inv.getOrgId(),inv.getLocationState(),deviceType);
}
......
......@@ -244,6 +244,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<Object[]> searchItem=new ArrayList<>();
for (UpdateOrderDetailReq listReq:req.getDetailList()) {
OrderDetail detail=new OrderDetail();
if (ObjectUtil.isEmpty(listReq.getProductionDate())|| listReq.getProductionDate().trim().isEmpty()){
listReq.setProductionDate(null);
}
BeanPlusUtil.copyProperties(listReq, detail);
detail.setOrderId(order.getId());
//设置单据类型
......@@ -1160,11 +1163,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
if (CollectionUtil.isNotEmpty(updateInvList)){
//更新数据库中实体类的状态
LambdaUpdateWrapper<Inventory> wp1 = Wrappers.<Inventory>lambdaUpdate();
String state="";
if (orderMain.getBussinessType().equals("destruction")){
req.setBussinessType("destory");
state="destory";
wp1.set(Inventory::getState, state)
.set(Inventory::getLocationState, req.getOrderType());
}else {
wp1.set(Inventory::getState, req.getBussinessType())
.set(Inventory::getLocationState, req.getOrderType());
}
wp1.set(Inventory::getState, req.getBussinessType())
.set(Inventory::getLocationState, req.getOrderType());
LambdaUpdateWrapper<WarehouseInventory> wp2 = Wrappers.<WarehouseInventory>lambdaUpdate();
wp2.set(WarehouseInventory::getLocationState, req.getOrderType());
for (int i = 0; i < updateInvList.size(); i++) {
......
......@@ -251,6 +251,11 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
mqDto.setMessage("Adding policemanInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);//推送至仓库主机
//更改类别,1为类型
mqDto.setType(10);
mqDto.setMessage("Adding UserInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);//推送至仓库主机
return policeman.getId();
}
......@@ -609,6 +614,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
one.setUpdateTime(DateTimeUtil.getCurrentDateTime());
SysUser user= sysUserService.getById(req.getUserId());
user.setPassword(req.getPassword());
user.setNickName(req.getName());
sysUserService.updateById(user);
//修改角色
if (req.getRolesList().size()>0){
......@@ -637,7 +643,11 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
mqDto.setApi("InfoChange");
//更改类别,1为类型
mqDto.setType(5);
mqDto.setMessage("Adding policemanInfo");
mqDto.setMessage("Updating policemanInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);
mqDto.setType(10);
mqDto.setMessage("Updating UserInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);
return updateById(one);
......@@ -1002,7 +1012,13 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
}
SysUser sysUser = sysUserService.getById(req.getUserId());
sysUser.setStatusFlag(req.getState());
MQDto mqDto = new MQDto();
mqDto.setApi("InfoChange");
//更改类别,1为类型
mqDto.setType(10);
mqDto.setMessage("Updating UserInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);
return sysUserService.updateById(sysUser);
}
......@@ -1904,82 +1920,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
return collect;
}
//添加人脸和指纹照片或修改
// @Override
// public boolean addFaceAndfinger(UpdatePolicemanReq req) {
// //人脸
// boolean a=true;
// boolean flag=false;
// Policeman one = getById(req.getId());
// if (one.getFaceInfo()!=null && !one.getFaceInfo().isEmpty()){
// flag=true;
// if(req.getFaceInfoList().size()>0 && !req.getFaceInfoList().get(0).equals(one.getFaceInfo())){
// one.setFaceInfo(req.getFaceInfoList().get(0));
// }else {
// one.setFaceInfo(null);
//
// }
// a = updateById(one);
// }else {
// flag=true;
// one.setFaceInfo(req.getFaceInfoList().get(0));
// a = updateById(one);
// }
// //指纹
// List<PoliceFinger> addFingerList=new ArrayList<>();
// List<PoliceFinger> delFingerList=new ArrayList<>();
// //库中存储的指纹信息
// List<PoliceFinger> fingerList = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
// .eq(PoliceFinger::getPoliceId, req.getId()));
// List<String> fingerInfoList = req.getFingerList();
// Set<String> set1 = new HashSet<>();
// for (PoliceFinger finger : fingerList) {
// set1.add(finger.getFingerInfo());
// }
// if (fingerList.size()>0){
// if (fingerInfoList.size()>0){
// for (String finger : fingerInfoList) {
// if (!set1.contains(finger)) {
// PoliceFinger finger1 = new PoliceFinger();
// finger1.setFingerInfo(finger);
// finger1.setPoliceId(req.getId());
// finger1.setCreateTime(DateTimeUtil.getCurrentDateTime());
// addFingerList.add(finger1);
// }
// }
// for (PoliceFinger finger : fingerList) {
// if (!fingerInfoList.contains(finger.getFingerInfo())) {
// delFingerList.add(finger);
// }
// }
// }else {
// delFingerList.addAll(fingerList);
// }
// }else {
// if (fingerInfoList.size()>0){
// for (String finger:fingerInfoList) {
// PoliceFinger finger1 = new PoliceFinger();
// finger1.setFingerInfo(finger);
// finger1.setPoliceId(req.getId());
// finger1.setCreateTime(DateTimeUtil.getCurrentDateTime());
// addFingerList.add(finger1);
// }
// }
// }
// boolean c=true;
// if (addFingerList.size()>0){
// flag=true;
// c=policeFingerService.saveBatch(addFingerList);
// }
// boolean d=true;
// if (delFingerList.size()>0){
// flag=true;
// d=policeFingerService.removeByIds(delFingerList);
// }
// return (a && c && d);
// }
//查询组织机构为null的警员
@Override
......@@ -2042,6 +1982,13 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
one.setPassword(password);
updateById(one);
//那么我直接将消息推送到相应单警柜以及本地主机
MQDto mqDto = new MQDto();
mqDto.setApi("InfoChange");
//更改类别,1为类型
mqDto.setType(10);
mqDto.setMessage("Updating UserInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);
}
return true;
......@@ -2073,6 +2020,13 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
SysUserReq sysUserReq = new SysUserReq();
BeanPlusUtil.copyProperties(req,sysUserReq);
sysUserService.editPassword(sysUserReq);
MQDto mqDto = new MQDto();
mqDto.setApi("InfoChange");
//更改类别,1为类型
mqDto.setType(10);
mqDto.setMessage("Updating UserInfo");
//警员添加成功之后,往消息队列推送人员更新的消息
MQ.SendMsg("warehouseMsg",req.getOrgId().toString(),mqDto);
return true;
}
......@@ -2121,232 +2075,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
return policemanMapper.alignUserInfo(orgId,date);
}
// @Override
// @Transactional(rollbackFor = Exception.class)
// public boolean oneClickAccountCreation(PubOrg pubOrg) throws IOException {
// //一次性创建一个组织机构下的三种系统账号(运维,仓管员,审核员)
// //先判断一下前端是否传递组织机构编号(如果传递,指定创建该组织机构下的三种账号)
// List<String> userAccountList=new ArrayList<>();
// userAccountList.add("yw");
// userAccountList.add("sh");
// userAccountList.add("gl");
// List<Long> userRoleList=new ArrayList<>();
// userRoleList.add(1663372027127402498L);
// userRoleList.add(1663372320355389441L);
// userRoleList.add(1528003832557232130L);
// List<SysUserRole> sysUserRoleList=new ArrayList<>() ;
// List<SysUserOrg> sysUserOrgList=new ArrayList<>() ;
// SysUser sysUser = new SysUser();
// boolean ywExists = false;
// boolean shExists = false;
// boolean glExists = false;
// if (ObjectUtil.isNull(pubOrg.getOrgCode()) || pubOrg.getOrgCode().trim().isEmpty()){
// //如果没有组织机构编号,需要判断全部组织机构下面是否已经存在对应的账号,如果存在则不创建账号,否则创建指定账号
// //将未被禁用的组织机构全部查询出来
//// List<PubOrg> orgList = pubOrgService.list(new LambdaQueryWrapper<PubOrg>().eq(PubOrg::getDelFlag, 1).eq(PubOrg::getStatusFlag, 1));
// List<PubOrg> orgList=searchAll(0, 3000);
//
// List<UserDto> userDtoYW = policemanMapper.oneClickAccountCreation(null,userAccountList.get(0)+"33%",userRoleList.get(0));
// List<UserDto> userDtosSH = policemanMapper.oneClickAccountCreation(null,userAccountList.get(1)+"33%",userRoleList.get(1));
// List<UserDto> userDtosGL = policemanMapper.oneClickAccountCreation(null,userAccountList.get(2)+"33%",userRoleList.get(2));
// List<CompletableFuture<Void>> futures = new ArrayList<>();
// List<CompletableFuture<Void>> futures1 = new ArrayList<>();
// List<CompletableFuture<Void>> futures2 = new ArrayList<>();
//
// for (PubOrg one: orgList) {
// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
// Map<String, List<?>> map = addRoleAndOrgYW(userDtoYW, one, ywExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist1 = (List<SysUserOrg>) map.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist1);
// List<SysUserRole> roleList1 = (List<SysUserRole>) map.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList1);
// });
//
// futures.add(future);
// }
// CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
//
//
// for (PubOrg one: orgList) {
// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
// Map<String, List<?>> map = addRoleAndOrgSH(userDtosSH, one, shExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist1 = (List<SysUserOrg>) map.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist1);
// List<SysUserRole> roleList1 = (List<SysUserRole>) map.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList1);
// });
//
// futures1.add(future);
// }
// CompletableFuture.allOf(futures1.toArray(new CompletableFuture[0])).join();
//
//
// for (PubOrg one: orgList) {
// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
// Map<String, List<?>> map = addRoleAndOrgGL(userDtosGL, one, glExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist1 = (List<SysUserOrg>) map.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist1);
// List<SysUserRole> roleList1 = (List<SysUserRole>) map.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList1);
// });
//
// futures2.add(future);
// }
//
// // 等待所有异步任务完成
// CompletableFuture.allOf(futures2.toArray(new CompletableFuture[0])).join();
//
//
// }else {
// //如果有组织机构编号,则判断该组织机构下面是否已经存在账号,如果存在,则不进行创建,否则进行创建
// PubOrg one = pubOrgService.getOne(new LambdaQueryWrapper<PubOrg>()
// .eq(PubOrg::getOrgCode, pubOrg.getOrgCode()));
// if (ObjectUtil.isNull(one)){
// throw new ServiceException(OrgExceptionEnum.ORG_NOT_EXIST);
// }
// List<UserDto> userDtos = policemanMapper.oneClickAccountCreation(one.getOrgId(),null,null);
//
// if (CollectionUtil.isEmpty(userDtos)){
// for (int i = 0; i < userAccountList.size(); i++) {
// sysUser.setUserId(null);
// //创建用户信息
// Long userId = addUser(sysUser, userAccountList.get(i), one);
// //创建关联表数据
// SysUserOrg sysUserOrg = new SysUserOrg();
// sysUserOrg.setOrgId(one.getOrgId());
// sysUserOrg.setUserId(userId);
// sysUserOrgList.add(sysUserOrg);
// //创建角色表数据
// SysUserRole sysUserRole = new SysUserRole();
// sysUserRole.setRoleId(userRoleList.get(i));
// sysUserRole.setUserId(userId);
// sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserRoleList.add(sysUserRole);
// }
//
// }else {
// Map<String, List<?>> mapYw = addRoleAndOrgYW(userDtos, one, ywExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist1=(List<SysUserOrg>)mapYw.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist1);
// List<SysUserRole> roleList1 =(List<SysUserRole>) mapYw.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList1);
//
// Map<String, List<?>> mapSh = addRoleAndOrgSH(userDtos, one, shExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist2=(List<SysUserOrg>)mapSh.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist2);
// List<SysUserRole> roleList2 =(List<SysUserRole>) mapSh.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList2);
//
// Map<String, List<?>> mapGl = addRoleAndOrgGL(userDtos, one, glExists, sysUser,
// sysUserOrgList, userRoleList, userAccountList, sysUserRoleList);
// List<SysUserOrg> userlist3=(List<SysUserOrg>)mapGl.get("sysUserOrgList");
// sysUserOrgList.addAll(userlist3);
// List<SysUserRole> roleList3 =(List<SysUserRole>) mapGl.get("sysUserRoleList");
// sysUserRoleList.addAll(roleList3);
//
// }
//
// sysUserOrgService.saveBatch(sysUserOrgList);
// sysUserRoleService.saveBatch(sysUserRoleList);
//
// }
//
// return true;
// }
// private Map<String,List<?>> addRoleAndOrgYW(List<UserDto> userDtos,PubOrg one,Boolean ywExists,SysUser sysUser,
// List<SysUserOrg> sysUserOrgList,List<Long> userRoleList,
// List<String> userAccountList,List<SysUserRole> sysUserRoleList){
// Map<String,List<?>> map=new HashMap<>();
// for (UserDto user:userDtos) {
// if (user.getAccount().equals("yw"+one.getOrgCode())){
// ywExists=true;
// break;
// }
// }
// if (!ywExists){
// sysUser.setUserId(null);
// Long userId = addUser(sysUser, userAccountList.get(0), one);
// //创建关联表数据
// SysUserOrg sysUserOrg = new SysUserOrg();
// sysUserOrg.setOrgId(one.getOrgId());
// sysUserOrg.setUserId(userId);
// sysUserOrgList.add(sysUserOrg);
// //创建角色表数据
// SysUserRole sysUserRole = new SysUserRole();
// sysUserRole.setRoleId(userRoleList.get(0));
// sysUserRole.setUserId(userId);
// sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserRoleList.add(sysUserRole);
// }
// map.put("sysUserRoleList",sysUserRoleList);
// map.put("sysUserOrgList",sysUserOrgList);
// return map;
// }
//
// private Map<String,List<?>> addRoleAndOrgSH(List<UserDto> userDtos,PubOrg one,Boolean shExists,SysUser sysUser,
// List<SysUserOrg> sysUserOrgList,List<Long> userRoleList,
// List<String> userAccountList,List<SysUserRole> sysUserRoleList){
// Map<String,List<?>> map=new HashMap<>();
// for (UserDto user:userDtos) {
// if (user.getAccount().equals("sh"+one.getOrgCode())){
// shExists=true;
// break;
// }
// }
// if (!shExists){
// sysUser.setUserId(null);
// Long userId = addUser(sysUser, userAccountList.get(1), one);
// //创建关联表数据
// SysUserOrg sysUserOrg = new SysUserOrg();
// sysUserOrg.setOrgId(one.getOrgId());
// sysUserOrg.setUserId(userId);
// sysUserOrgList.add(sysUserOrg);
// //创建角色表数据
// SysUserRole sysUserRole = new SysUserRole();
// sysUserRole.setRoleId(userRoleList.get(1));
// sysUserRole.setUserId(userId);
// sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserRoleList.add(sysUserRole);
// }
// map.put("sysUserRoleList",sysUserRoleList);
// map.put("sysUserOrgList",sysUserOrgList);
// return map;
// }
//
// private Map<String,List<?>> addRoleAndOrgGL(List<UserDto> userDtos,PubOrg one,Boolean glExists,SysUser sysUser,
// List<SysUserOrg> sysUserOrgList,List<Long> userRoleList,
// List<String> userAccountList,List<SysUserRole> sysUserRoleList){
// Map<String,List<?>> map=new HashMap<>();
// for (UserDto user:userDtos) {
// if (user.getAccount().equals("gl"+one.getOrgCode())){
// glExists = true;
// break;
// }
//
// }
// if (!glExists){
// sysUser.setUserId(null);
// Long userId = addUser(sysUser, userAccountList.get(2), one);
// SysUserOrg sysUserOrg = new SysUserOrg();
// sysUserOrg.setOrgId(one.getOrgId());
// sysUserOrg.setUserId(userId);
// sysUserOrgList.add(sysUserOrg);
// //创建角色表数据
// SysUserRole sysUserRole = new SysUserRole();
// sysUserRole.setRoleId(userRoleList.get(2));
// sysUserRole.setUserId(userId);
// sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserRoleList.add(sysUserRole);
// }
// map.put("sysUserRoleList",sysUserRoleList);
// map.put("sysUserOrgList",sysUserOrgList);
// return map;
// }
private Long addUser(SysUser sysUser,String i,PubOrg pubOrg){
if (i.equals("yw")) {
......@@ -2531,23 +2259,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
sysUserRoleList.add(sysUserRole);
// sysUser.setUserId(null);
// //创建用户信息
// SysUser Adduser = addUserAndReturn(sysUser, userAccountList.get(i), one);
// sysUserService.save(Adduser);
// //创建角色表数据
// SysUserRole sysUserRole = new SysUserRole();
// sysUserRole.setRoleId(userRoleList.get(i));
// sysUserRole.setUserId(Adduser.getUserId());
// sysUserRole.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserRoleService.save(sysUserRole);
// //创建关联表数据
// SysUserOrg sysUserOrg = new SysUserOrg();
// sysUserOrg.setOrgId(one.getOrgId());
// sysUserOrg.setUserId(Adduser.getUserId());
// sysUserOrg.setCreateTime(DateTimeUtil.getCurrentDateTime());
// sysUserOrgService.save(sysUserOrg);
}
}else {
......
......@@ -868,6 +868,16 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
return pubOrg;
}
@Override
public Long findCodeToOrgId(PubOrg pubOrg) {
PubOrg one = getOne(new LambdaQueryWrapper<PubOrg>()
.eq(PubOrg::getFindCode, pubOrg.getFindCode())
.or()
.eq(PubOrg::getOrgCode, pubOrg.getFindCode())
.orderByAsc(PubOrg::getLevelFlag).last("limit 1"));
return one.getOrgId();
}
}
......
......@@ -97,13 +97,12 @@ public class PublicServiceImpl implements PublicService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateMessage(MessageReq req) {
SysMessage message = sysMessageService.getById(req.getMsgIdList().get(0));
req.setBizId(message.getBizId());
messageApi.updateMsgReadFlag(req);
//将该条消息全设置为已读并且更新再推送一条消息
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().eq(SysMessage::getBizId, message.getBizId()));
sysMessageService.update(new LambdaUpdateWrapper<SysMessage>()
.set(SysMessage::getReadFlag,1)
.eq(SysMessage::getBizId,req.getBizId()));
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().eq(SysMessage::getBizId, req.getBizId()));
List<Long> userIdList = list.stream().map(SysMessage::getReceiveUserId).collect(Collectors.toList());
MessageSendReq sendReq = new MessageSendReq();
......@@ -112,6 +111,7 @@ public class PublicServiceImpl implements PublicService {
.collect(Collectors.joining(",")));
sendReq.setMsgTitle("refresh");
sendReq.setMsgContent("消息更新");
sendReq.setBizType("");
sendReq.setPriority("1");
sendReq.setSendTime(DateTime.now());
messageApi.sendMessageNoToken(sendReq);
......@@ -119,16 +119,6 @@ public class PublicServiceImpl implements PublicService {
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean setReadMessage(MessageReq req) {
List<Long> msgIdList = req.getMsgIdList();
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getMsgId, msgIdList));
List<Long> collect = list.stream().map(SysMessage::getBizId).collect(Collectors.toList());
List<SysMessage> list1 = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getBizId, collect));
return sysMessageService.update(new LambdaUpdateWrapper<SysMessage>()
.set(SysMessage::getReadFlag, 1)
.in(SysMessage::getBizId, list1));
}
}
......@@ -871,9 +871,8 @@ public class TjServiceImpl implements TjService {
// @Override
public List<TjOrgCountDto> TjOrgCountDetail(TjOrgCountReq req) {
if ((req.getColumn().equals("createTime") && req.getOrder().equals("desc"))||(req.getColumn().equals("createTime") && req.getOrder().equals("asc"))){
if (req.getColumn().equals("createTime")){
req.setColumn(null);
req.setOrder(null);
}
if (ObjectUtil.isNotNull(req.getColumn()) && !req.getColumn().trim().isEmpty() &&
(req.getOrder().equalsIgnoreCase("asc")|| req.getOrder().equalsIgnoreCase("desc")) &&
......
......@@ -119,6 +119,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
}
Warehouse warehouse = new Warehouse();
BeanPlusUtil.copyProperties(req, warehouse);
warehouse.setOrgIdInt(req.getOrgId());
warehouse.setCreateTime(DateTimeUtil.getCurrentDateTime());
warehouse.setUpdateTime(DateTimeUtil.getCurrentDateTime());
save(warehouse);
......
......@@ -322,27 +322,48 @@
WHERE
YEAR = #{year}
and `po`.`del_flag` = 1
<if test="level ==null">and (po.org_id =#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="
levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level==1">
and (po.org_id !=#{orgId} and (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
<if test="typeIdsList!=null and typeIdsList.size() > 0">
and vecs.type_id in
<foreach collection="typeIdsList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="typeParentId != null and typeParentId !=''">
and vecs.type_parent_id=#{typeParentId}
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
vecs.size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
<if test="monthList != null and monthList.size()>0">
and vecs.month in
<foreach collection="monthList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="level ==null">
and (po.org_id =#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level == 0 ">
and po.org_id =#{orgId}
</if>
</if>
<if test="level==1">
and (po.org_id !=#{orgId} and (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level == 0 ">
and po.org_id =#{orgId}
</if>
GROUP BY
`year`,MONTH,size_id,size_name,type_id,type_name
) AS t
......@@ -354,6 +375,9 @@
<if test="column != null and column != '' and order != null and order != '' ">
order by ${column} ${order}
</if>
<if test="column == null">
order by type_id
</if>
</select>
<select id="TjOrgCountTotalDetail" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto">
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
......
......@@ -780,6 +780,30 @@
</if>
)as b
</select>
<select id="selectSum" resultType="com.junmp.jyzb.entity.Inventory">
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,
wi.type_name,wi.org_name,wi.size_name,wi.location_name,i.epc_type,
wi.location_type,wi.location_id,i.id ,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
WHERE
(
<foreach collection="list" item="item" separator="or">
wi.org_id='${item[0]}'
and wi.location_id ='${item[1]}'
and wi.type_id='${item[2]}'
and wi.size_id='${item[3]}'
and i.price='${item[4]}'
and i.property='${item[5]}'
</foreach>
)
and wi.location_type=0
and i.location_state = "in"
and (DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) &lt; NOW() or i.warranty_period != 0)
and i.epc_type=#{epcType}
</select>
<select id="EqsByState" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
select
......
......@@ -577,7 +577,7 @@
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )+
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END )
) AS total_number,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) AS `ck_stock_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) AS `ck_outbound_number`,
......@@ -768,10 +768,10 @@
select count(*) from (
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.property,
i.production_date,i.warranty_period,i.maintenance_period,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
es.instructions as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo,
(case when DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) > NOW() or i.warranty_period = 0 then 0 else 1 end)as term_state
......@@ -807,6 +807,9 @@
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
<if test="req.state !='all' and req.state !=''">
and i.state=#{req.state}
</if>
ORDER BY wi.type_id,i.size_id
) as a
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.InventorySummaryMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.InventorySummary">
<!--@mbg.generated-->
<!--@Table base_inventory_summary-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
<result column="size_id" jdbcType="VARCHAR" property="sizeId" />
<result column="size_name" jdbcType="VARCHAR" property="sizeName" />
<result column="location_type" jdbcType="VARCHAR" property="locationType" />
<result column="location_id" jdbcType="VARCHAR" property="locationId" />
<result column="location_name" jdbcType="VARCHAR" property="locationName" />
<result column="number" jdbcType="INTEGER" property="number" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="stock_number" jdbcType="INTEGER" property="stockNumber" />
<result column="outbound_number" jdbcType="INTEGER" property="outboundNumber" />
<result column="destruction_number" jdbcType="INTEGER" property="destructionNumber" />
<result column="expire_number" jdbcType="INTEGER" property="expireNumber" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="threshold" jdbcType="INTEGER" property="threshold" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, org_id, org_name, type_id, type_name, size_id, size_name, location_type, location_id,
location_name, `number`, price, stock_number, outbound_number,
destruction_number, expire_number, create_time, update_time,threshold
</sql>
<select id="GetInventorySumInfo" resultType="com.junmp.jyzb.api.bean.dto.InventorySumDto"
parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">
select max(bis.org_id_int) as orgId,max(bis.org_name) as orgName,bis.location_id,max(bis.location_name) as location_name
<if test="req.locationId !=null and req.locationId != ''">
,bis.type_id,max(bis.type_name) as type_name,bet.unit,bet.unit_type
</if>
<if test="req.typeId != null and req.typeId != ''">
,bis.size_id,max(bis.size_name) as size_name
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
,bis.unit_price,max(bis.stock_number) as stock_number
</if>
FROM base_inventory_summary bis
join base_equipment_type bet on bet.id = bis.type_id
where org_id_int =#{req.orgId}
<if test="req.locationId !=null and req.locationId != ''">
and location_id=#{req.locationId}
</if>
<if test="req.typeId != null and req.typeId != ''">
and type_id=#{req.typeId}
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
and size_id=#{req.sizeId}
</if>
GROUP BY bis.location_id
<if test="req.locationId !=null and req.locationId != ''">
,bis.type_id
</if>
<if test="req.typeId != null and req.typeId != ''">
,bis.size_id
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
,bis.unit_price
</if>
</select>
<delete id="deleteByCabinet" parameterType="java.lang.String">
delete from base_inventory_summary where locationId = #{cabinetId}
</delete>
<update parameterType="java.lang.String" id="id">
UPDATE vie_price_sum_summary
SET
add_price = CASE
WHEN add_price IS NULL THEN start_price - end_price
ELSE add_price
END,
add_num = CASE
WHEN add_num IS NULL THEN start_num - end_num
ELSE add_num
END
WHERE add_price IS NULL OR add_num IS NULL;
</update>
<insert id="setWarrantyInventoryAction" statementType="CALLABLE">
{CALL Insert_into_base_warranty_inventory()}
</insert>
<insert id="setDestoryGroupAction" statementType="CALLABLE">
{CALL Insert_into_view_destory_group()}
</insert>
<insert id="setWarrantyGroupAction" statementType="CALLABLE">
{CALL Insert_into_view_warranty_group()}
</insert>
<insert id="getSumByCabinet">
INSERT INTO base_inventory_summary (id,org_id_int,org_name,type_id, type_name,size_id,size_name,location_id,location_name,
number,unit_price,price,stock_number, outbound_number,destruction_number,expire_number,
broken_number,use_number,fix_number,location_type,create_time,update_time)
select
MAX(t.id) as id,t.orgId,t.orgName,t.type_id,t.typeName,t.size_id,t.sizeName,t.locationId,t.locationName,sum(t.number) as number,
t.unitPrice,sum(t.price)as price,sum(t.stockNumber)as stockNumber,sum(t.outboundNumber)as outboundNumber,
sum(t.destructionNumber)as destructionNumber,sum(t.expireNumber)as expireNumber,sum(t.brokenNumber)as brokenNumber,
sum(t.useNumber)as useNumber,sum(t.fixNumber)as fixNumber,t.location_type,NOW(),NOW()
FROM
(SELECT
UUID() as id,
bi.org_id_int as orgId,
po.org_name as orgName,
bcb.cabinet_id as locationId,
bi.location_id as locationBoxId,
bc.name as locationName,
bi.type_id,
t.name as typeName,
bi.size_id,
s.name as sizeName,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END)+SUM(CASE WHEN location_state = 'out' and bi.state!='destory' THEN 1 ELSE 0 END) as number,
bi.price as unitPrice,
sum(bi.price) as price,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
SUM(CASE WHEN location_state = 'out' and bi.state!='destory' THEN 1 ELSE 0 END) AS outboundNumber,
sum(case when bi.state = 'destory' then 1 else 0 end) as destructionNumber,
sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH) &gt; NOW() then 1 else 0 end )as expireNumber,
sum(case when bi.state ='broken' and bi.location_state='in' then 1 else 0 end)as brokenNumber,
sum(case when bi.bussiness_state = 'borrow' and bi.location_state='out' then 1
when bi.bussiness_state = 'take' and bi.location_state='out' then 1 else 0 end)as useNumber,
sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH) &lt; NOW()
and DATEDIFF(DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH),NOW()) &lt; #{brokenNumberDays} then 1 else 0 end)as fixNumber,
bi.location_type
FROM base_inventory bi
join base_cabinet_box bcb on bi.location_id = bcb.id
join base_cabinet bc on bcb.cabinet_id = bc.id
join base_equipment_type t on t.id = bi.type_id
join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 1 and bcb.cabinet_id=#{cabinetId}
GROUP BY location_id, type_id,size_id,bi.org_id_int,bi.price ) as t
GROUP BY t.locationId,t.type_id,t.size_id,t.orgId,t.unitPrice
</insert>
<select id="getTotalNumberAndPrice" resultType="com.junmp.jyzb.entity.InventorySummary">
select sum(is.number) as number,sum(is.price)as price,
sum(is.stock_number)as stockNumber,sum(is.stock_number * unit_price) as stockNumberPrice,
sum(is.outbound_number)as outboundNumber,sum(is.outbound_number * unit_price) as outboundNumberPrice,
sum(is.destruction_number)as destructionNumber,sum(is.destruction_number * unit_price) as destructionNumberPrice,
sum(is.expire_number)as expireNumber,sum(is.expire_number * unit_price) as expireNumberPrice,
sum(is.broken_number)as brokenNumber,sum(is.broken_number * unit_price) as brokenNumberPrice
<if test="req.orgId != null and req.orgId != ''">
,is.org_id_int as orgId
</if>
<if test="req.locationId !=null and req.locationId != ''">
,is.location_id as locationId
</if>
<if test="req.locationType != null and req.locationType != ''">
,is.location_type as locationType
</if>
FROM base_inventory_summary `is`
join base_equipment_type et on is.type_id=et.id
where 1=1
<if test="req.typeIds !=null and req.typeIds.size()>0">
and (
<foreach collection="req.typeIds" item="item" open="(" separator="or" close=")">
et.id=#{item} or et.parent_ids like CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="req.orgId != null and req.orgId != ''">
and is.org_id_int=#{req.orgId}
</if>
<if test="req.locationId !=null and req.locationId != ''">
and is.location_id=#{req.locationId}
</if>
<if test="req.sizeId != null and req.sizeId != ''">
and is.size_id=#{req.sizeId}
</if>
<if test="req.TypeId != null and req.typeId != ''">
and is.type_id=#{req.typeId}
</if>
<if test="req.locationType != null and req.locationType != ''">
and is.location_type=#{req.locationType}
</if>
<choose>
<when test="req.number != null and req.number != ''">
<if test="req.number.charAt(0) == '='">
AND is.number = SUBSTRING(#{req.number}, 2)
</if>
<if test="req.number.charAt(0) == '&lt;'">
AND is.number &lt; SUBSTRING(#{req.number}, 2)
</if>
<if test="req.number.charAt(0) == '&gt;'">
AND is.number &gt; SUBSTRING(#{req.number}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.stockNumber != null and req.stockNumber != ''">
<if test="req.stockNumber.charAt(0) == '='">
AND is.stock_number = SUBSTRING(#{req.stockNumber}, 2)
</if>
<if test="req.stockNumber.charAt(0) == '&lt;'">
AND is.stock_number &lt; SUBSTRING(#{req.stockNumber}, 2)
</if>
<if test="req.stockNumber.charAt(0) == '&gt;'">
AND is.stock_number &gt; SUBSTRING(#{req.stockNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.outboundNumber != null and req.outboundNumber != ''">
<if test="req.outboundNumber.charAt(0) == '='">
AND is.outbound_number = SUBSTRING(#{req.outboundNumber}, 2)
</if>
<if test="req.outboundNumber.charAt(0) == '&lt;'">
AND is.outbound_number &lt; SUBSTRING(#{req.outboundNumber}, 2)
</if>
<if test="req.outboundNumber.charAt(0) == '&gt;'">
AND is.outbound_number &gt; SUBSTRING(#{req.outboundNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.expireNumber != null and req.expireNumber != ''">
<if test="req.expireNumber.charAt(0) == '='">
AND is.expire_number = SUBSTRING(#{req.expireNumber}, 2)
</if>
<if test="req.expireNumber.charAt(0) == '&lt;'">
AND is.expire_number &lt; SUBSTRING(#{req.expireNumber}, 2)
</if>
<if test="req.expireNumber.charAt(0) == '&gt;'">
AND is.expire_number &gt; SUBSTRING(#{req.expireNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.brokenNumber != null and req.brokenNumber != ''">
<if test="req.brokenNumber.charAt(0) == '='">
AND is.broken_number = SUBSTRING(#{req.brokenNumber}, 2)
</if>
<if test="req.brokenNumber.charAt(0) == '&lt;'">
AND is.broken_number &lt; SUBSTRING(#{req.brokenNumber}, 2)
</if>
<if test="req.brokenNumber.charAt(0) == '&gt;'">
AND is.broken_number &gt; SUBSTRING(#{req.brokenNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.unitPrice != null and req.unitPrice != ''">
<if test="req.unitPrice.charAt(0) == '='">
AND is.unit_price = SUBSTRING(#{req.unitPrice}, 2)
</if>
<if test="req.unitPrice.charAt(0) == '&lt;'">
AND is.unit_price &lt; SUBSTRING(#{req.unitPrice}, 2)
</if>
<if test="req.unitPrice.charAt(0) == '&gt;'">
AND is.unit_price &gt; SUBSTRING(#{req.unitPrice}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.price != null and req.price != ''">
<if test="req.price.charAt(0) == '='">
AND is.price = SUBSTRING(#{req.price}, 2)
</if>
<if test="req.price.charAt(0) == '&lt;'">
AND is.price &lt; SUBSTRING(#{req.price}, 2)
</if>
<if test="req.price.charAt(0) == '&gt;'">
AND is.price &gt; SUBSTRING(#{req.price}, 2)
</if>
</when>
</choose>
</select>
<select id="EquipmentStatistics" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">
select sum(number) as number,sum(price)as price,sum(stock_number)as stockNumber,
sum(outbound_number)as outboundNumber,sum(destruction_number)as destructionNumber,
sum(expire_number)as expireNumber,sum(broken_number)as brokenNumber,
sum(fix_number)as fixNumber,sum(use_number)as useNumber
FROM base_inventory_summary where org_id_int=#{req.orgId}
</select>
<select id="selectByEqs" resultType="com.junmp.jyzb.entity.InventorySummary">
SELECT sum(stock_number) as stockNumber,size_id as sizeId,type_id as typeId,MAX(size_name) as sizeName,
MAX(type_name) as typeName,org_id_int as orgId,MAX(org_name) as orgName
FROM base_inventory_summary where org_id_int=#{orgId}
GROUP BY size_id,type_id
HAVING stockNumber>0
</select>
<select id="selectSumByItems" resultType="com.junmp.jyzb.entity.InventorySummary">
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,fix_price,fix_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property
from base_inventory_summary where
<foreach collection="list" item="item" separator="or">
(
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}'
AND unit_price = ${item[4]}
)
</foreach>
</select>
<select id="selectSum" resultType="com.junmp.jyzb.entity.InventorySummary">
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,fix_price,fix_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property
from base_inventory_summary where
<foreach collection="list" item="item" separator="or">
(
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}'
AND unit_price = ${item[4]}
and property=${item[5]}
)
</foreach>
</select>
<select id="getByOrgId" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto"
parameterType="java.lang.Long">
select * from view_orgeqs_sum where org_id=#{orgId} or parent_id=#{orgId}
</select>
<select id="getEqsByOrgId" resultType="com.junmp.jyzb.api.bean.dto.EqsSumDto">
SELECT type_id,max(type_name) as type_name,org_id_int as org_id,max(org_name) as org_name,
<if test="sizeId !=null and sizeId != ''">
size_id,max(size_name) as size_name,
</if>
(sum((case when (`its`.`location_type` = 0) then `its`.`stock_number` else 0 end))+sum((case when (`its`.`location_type` = 0) then `its`.`outbound_number` else 0 end))+sum((case when (`its`.`location_type` = 0) then `its`.`destruction_number` else 0 end))) as number,
sum((case when (`its`.`location_type` = 0) then `its`.`stock_number` else 0 end)) AS `ck_stock_number`,
sum((case when (`its`.`location_type` = 0) then `its`.`outbound_number` else 0 end)) AS `ck_outbound_number`,
sum((case when (`its`.`location_type` = 0) then `its`.`destruction_number` else 0 end)) AS `destruction_number`,
sum((case when (`its`.`location_type` = 1) then `its`.`stock_number` else 0 end)) AS `djg_stock_number`,
sum((case when (`its`.`location_type` = 1) then `its`.`outbound_number` else 0 end)) AS `djg_outbound_number`
FROM `base_inventory_summary_type2` its
where org_id_int IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="typeId !=null and typeId != ''">
and type_id=#{typeId}
</if>
<if test="sizeId !=null and sizeId != ''">
and size_id=#{sizeId}
</if>
GROUP BY org_id_int,type_id
<if test="sizeId !=null and sizeId != ''">
,size_id
</if>
</select>
<select id="test" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto" statementType="CALLABLE">
{CALL view_sum_total(#{req.typeId, mode=IN, jdbcType=VARCHAR})}
</select>
<select id="GetInvSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto" statementType="CALLABLE">
{CALL GetInventorySummary(#{orgId,mode=IN},#{typeId,mode=IN},#{sizeName,mode=IN})}
</select>
<select id="GetInvSelfSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto" statementType="CALLABLE">
{CALL GetInvSelfSummary(#{orgId,mode=IN},#{typeId,mode=IN},#{sizeName,mode=IN})}
</select>
<select id="GetSumLeve4" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto" statementType="CALLABLE">
{CALL GetSumLeve4(#{orgId,mode=IN},#{typeId,mode=IN},#{sizeName,mode=IN},#{sql,mode=IN})}
</select>
<select id="selectDynamicView" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto">
SELECT * FROM dynamic_view
</select>
<select id="selectViewOrgeqsSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto">
select * from view_orgeqs_sum
</select>
<delete id="deleteByWarehouse"
parameterType="com.junmp.jyzb.api.bean.dto.WarehouseDto">
delete from base_inventory_summary
where location_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<insert id="getSumByWarehouse" >
INSERT INTO base_inventory_summary (id,org_id_int,org_name,location_id,location_name,type_id, type_name,size_id,
size_name,number,unit_price,price, stock_number, outbound_number,destruction_number,
expire_number,broken_number,use_number,fix_number,location_type,create_time,update_time)
select
MAX(t.id) as id,t.orgId,t.orgName,t.locationId,MAX(t.locationName),t.type_id,t.typeName,t.size_id,t.sizeName,
sum(t.number) as number,t.unitPrice,sum(t.price)as price,sum(t.stockNumber)as stockNumber,sum(t.outboundNumber)as outboundNumber,
sum(t.destructionNumber)as destructionNumber,sum(t.destructionNumber) as expireNumber,sum(t.brokenNumber) as brokenNumber,
sum(t.useNumber)as useNumber,sum(t.fixNumber)as fixNumber,t.location_type,NOW(),NOW()
FROM
(SELECT
UUID() as id,
bi.org_id_int as orgId,
po.org_name as orgName,
MAX(bi.location_id) as locationId,
MAX(bw.name) as locationName,
bi.type_id,
t.name as typeName,
bi.size_id,
s.name as sizeName,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END)+SUM(CASE WHEN location_state = 'out' and bi.state!='destory' THEN 1 ELSE 0 END) as number,
bi.price as unitPrice,
sum(bi.price) as price,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
SUM(CASE WHEN location_state = 'out' and bi.state!='destory' THEN 1 ELSE 0 END) AS outboundNumber,
sum(case when bi.state = 'destory' then 1 else 0 end) as destructionNumber,
sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH) &gt; NOW() then 1 else 0 end )as expireNumber,
sum(case when bi.state ='broken' and bi.location_state='in' then 1 else 0 end)as brokenNumber,
sum(case when bi.bussiness_state = 'borrow' and bi.location_state='out' then 1
when bi.bussiness_state = 'take' and bi.location_state='out' then 1 else 0 end)as useNumber,
sum(case when bi.warranty_period=0 then 0 when DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH) &lt; NOW()
and DATEDIFF(DATE_ADD(bi.production_date,INTERVAL bi.warranty_period MONTH),NOW()) &lt; #{brokenNumberDays} then 1 else 0 end)as fixNumber,
bi.location_type
FROM base_inventory bi
join base_warehouse bw on bi.location_id = bw.id
join base_equipment_type t on t.id = bi.type_id
join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0
and bi.location_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item.id}
</foreach>
GROUP BY type_id,size_id,bi.org_id_int,location_id,bi.price) as t
GROUP BY t.locationId,t.type_id,t.size_id,t.orgId,t.unitPrice
</insert>
<insert id="insertToSummary" statementType="CALLABLE">
{call InsertInventorySummary(
#{summaryTableName, mode=IN},
#{sourceTableName, mode=IN},
#{warrantyThreshold, mode=IN, jdbcType=INTEGER}
)}
</insert>
<insert id="useViewOrgeqs" statementType="CALLABLE">
{CALL view_orgeqs(#{sql,mode=IN},#{orgId,mode=IN},#{sql1,mode=IN})}
</insert>
<insert id="useViewOrgIdInSubordinate" parameterType="java.lang.String">
{CALL view_orgIdInSubordinate(#{sql,mode=IN})}
</insert>
<insert id="useViewOrgIdInLevel">
{CALL view_orgIdInLevel(#{sql,mode=IN},#{orgId,mode=IN})}
</insert>
<select id="getTotalData" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
`po`.`org_id` AS `org_id`
FROM `pub_org` `po`
LEFT JOIN `base_inventory_summary` `bis` ON `po`.`org_id` = `bis`.`org_id_int`
WHERE `po`.`del_flag` = 1
and (po.org_id=#{orgId} or `po`.org_parent_id=#{orgId})
and `po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} )+1
GROUP BY org_id
</select>
<select id="getTotalDataDetail" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgEqsDto">
SELECT
`po`.`org_id` AS `org_id`,
`po`.`org_code` AS `org_code`,
`po`.`org_parent_id` AS `parent_id`,
`po`.`org_name` AS `org_name`,
`po`.`level_flag` AS `level_flag`,
`po`.`d_name` AS `d_name`,
COALESCE (
sum(
CASE
WHEN ( `bis`.`location_type` = 0 ) THEN
`bis`.`stock_number` ELSE 0
END
) + sum(
CASE
WHEN ( `bis`.`location_type` = 0 ) THEN
`bis`.`outbound_number` ELSE 0
END
) +sum(
CASE
WHEN(`bis`.`location_type` = 1) then
`bis`.`stock_number` ELSE 0
END
)+SUM(
CASE
WHEN ( `bis`.`location_type` = 1 ) THEN
`bis`.`outbound_number` ELSE 0
END
),
0
) AS `total_number`,
COALESCE ( sum( CASE WHEN ( `bis`.`location_type` = 0 ) THEN `bis`.`stock_number` ELSE 0 END ), 0 ) AS `ck_stock_number`,
COALESCE ( sum( CASE WHEN ( `bis`.`location_type` = 0 ) THEN `bis`.`outbound_number` ELSE 0 END ), 0 ) AS `ck_outbound_number`,
COALESCE ( sum( CASE WHEN ( `bis`.`location_type` = 0 ) THEN `bis`.`destruction_number` ELSE 0 END ), 0 ) AS `destruction_number`,
COALESCE ( sum( CASE WHEN ( `bis`.`location_type` = 1 ) THEN `bis`.`stock_number` ELSE 0 END ), 0 ) AS `djg_stock_number`,
COALESCE ( sum( CASE WHEN ( `bis`.`location_type` = 1 ) THEN `bis`.`outbound_number` ELSE 0 END ), 0 ) AS `djg_outbound_number`
FROM `pub_org` `po`
LEFT JOIN `base_inventory_summary` `bis` ON `po`.`org_id` = `bis`.`org_id_int`
WHERE
`po`.`del_flag` = 1
<if test="level ==null" >
and (po.org_id =#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level==1">
and (po.org_id !=#{orgId} and (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if test="levelNum !=0">
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} ))
</if>
<if test="level == 0 ">
and po.org_id = #{orgId}
</if>
<if test="typeIdsList!=null and typeIdsList.size() > 0">
AND type_id IN
<foreach collection="typeIdsList " item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY `po`.`org_id`,`po`.`org_code`,`po`.`org_parent_id`,`po`.`org_name`
<if test="column != null and column != '' and order != null and order != '' ">
order by ${column} ${order}
</if>
</select>
<select id="getSumByViewOrgeqsSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgEqsDto">
select sum(total_number) as total_number,
sum(ck_stock_number) as ck_stock_number,
sum(ck_outbound_number) as ck_outbound_number,
sum(destruction_number) as destruction_number,
sum(djg_stock_number) as djg_stock_number,
sum(djg_outbound_number) as djg_outbound_number
FROM view_orgeqs_sum
</select>
<select id="TjOrgEqsDetail" resultType="com.junmp.jyzb.api.bean.dto.InventorySumDto">
SELECT
type_name,
size_name,
type_id,
size_id,
(
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )+
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )
) AS total_number,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) AS `ck_stock_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) AS `ck_outbound_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`destruction_number` ELSE 0 END ) AS `destruction_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 1 ) THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) AS `djg_stock_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 1 ) THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) AS `djg_outbound_number`
FROM
base_inventory_summary
WHERE
org_id_int = #{orgId}
<if test="typeIdsList!=null and typeIdsList.size() > 0">
AND type_id IN
<foreach collection="typeIdsList " item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="sizeNameList!=null and sizeNameList.size() > 0">
AND
<foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">
size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY
type_id,
type_name,
size_name,
size_id
<if test="column != null and column != '' and order != null and order != '' ">
order by ${column} ${order}
</if>
<if test="column == null and order == null">
ORDER BY type_id
</if>
</select>
<select id="selectTotalNum" resultType="com.junmp.jyzb.api.bean.dto.InventorySumDto">
<foreach collection="list" item="item" separator="union all">
SELECT COALESCE(SUM(stock_number), 0) as stock_number,
COALESCE(type_id,${item[0]}) as type_id ,
COALESCE( size_id,'${item[1]}') as size_id
FROM base_inventory_summary
WHERE org_id_int = #{orgId} and (type_id = ${item[0]} AND size_id = '${item[1]}')
</foreach>
</select>
<select id="GetEquipmentSummarySum" resultType="java.lang.Integer"
parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">
select count(*) from (
SELECT
is.type_id,
is.type_name,
sum( is.number ) AS number,
sum( is.number * is.unit_price ) AS price,
sum( is.stock_number ) AS stock_number,
sum( is.stock_number * is.unit_price ) AS stock_number_price,
sum( is.outbound_number ) AS outbound_number,
sum( is.outbound_number * is.unit_price ) AS outbound_number_price,
sum( is.destruction_number ) AS destruction_number,
sum( is.destruction_number * is.unit_price ) AS destruction_number_price ,
sum( is.expire_number) as expire_number,
sum( is.expire_number * is.unit_price ) AS expire_number_price ,
sum( is.broken_number) as broken_number,
sum( is.broken_number * is.unit_price ) AS broken_number_price
FROM
base_inventory_summary `is`
join base_equipment_type et on is.type_id=et.id
WHERE
is.org_id_int = #{req.orgId}
<if test="req.typeIds !=null and req.typeIds.size()>0">
and (
<foreach collection="req.typeIds" item="item" open="(" separator="or" close=")">
et.id=#{item} or et.parent_ids like CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="req.locationType !='all' and req.locationType != null ">
and is.location_type=#{req.locationType}
</if>
<if test="req.locationId !=null and req.locationId !=''">
and is.location_id=#{req.locationId}
</if>
<if test="req.property !='all' and req.property != null">
and is.property=#{req.property}
</if>
GROUP BY
is.type_id,
is.type_name
ORDER BY
is.type_id
) as a
</select>
<select id="GetEquipmentSummary" resultType="com.junmp.jyzb.entity.InventorySummary">
SELECT
is.type_id,
is.type_name,
sum( is.number ) AS number,
sum( is.number * is.unit_price ) AS price,
sum( is.stock_number ) AS stock_number,
sum( is.stock_number * is.unit_price ) AS stock_number_price,
sum( is.outbound_number ) AS outbound_number,
sum( is.outbound_number * is.unit_price ) AS outbound_number_price,
sum( is.destruction_number ) AS destruction_number,
sum( is.destruction_number * is.unit_price ) AS destruction_number_price ,
sum( is.expire_number) as expire_number,
sum( is.expire_number * is.unit_price ) AS expire_number_price ,
sum( is.broken_number) as broken_number,
sum( is.broken_number * is.unit_price ) AS broken_number_price
FROM
base_inventory_summary `is`
join base_equipment_type et on is.type_id=et.id
WHERE
is.org_id_int = #{req.orgId}
<if test="req.typeIds !=null and req.typeIds.size()>0">
and (
<foreach collection="req.typeIds" item="item" open="(" separator="or" close=")">
et.id=#{item} or et.parent_ids like CONCAT('%', #{item}, '%')
</foreach>
)
</if>
<if test="req.locationType !='all' and req.locationType != null">
and is.location_type=#{req.locationType}
</if>
<if test="req.locationId !=null and req.locationId !=''">
and is.location_id=#{req.locationId}
</if>
<if test="req.property !='all' and req.property != null">
and is.property=#{req.property}
</if>
GROUP BY
is.type_id,
is.type_name
<if test="req.column != 'create_time' ">
order by ${req.column} ${req.order}
</if>
<if test="req.column == 'create_time' ">
order by is.type_id asc
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="GetEquipmentSummaryDetail" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">
SELECT
is.type_id,
is.type_name,
is.size_id,
is.size_name,
is.unit_price,
sum( is.number ) AS number,
sum( is.number * is.unit_price ) AS price,
sum( is.stock_number ) AS stock_number,
sum( is.stock_number * is.unit_price ) AS stock_number_price,
sum( is.outbound_number ) AS outbound_number,
sum( is.outbound_number * is.unit_price ) AS outbound_number_price,
sum( is.destruction_number ) AS destruction_number,
sum( is.destruction_number * is.unit_price ) AS destruction_number_price ,
sum( is.expire_number) as expire_number,
sum( is.expire_number * is.unit_price ) AS expire_number_price ,
sum( is.broken_number) as broken_number,
sum( is.broken_number * is.unit_price ) AS broken_number_price
FROM
base_inventory_summary `is`
WHERE
is.org_id_int = #{req.orgId} and is.type_id=#{req.typeId}
<if test="req.locationType !='all' and req.locationType != null">
and is.location_type=#{req.locationType}
</if>
<if test="req.locationId !=null and req.locationId !=''">
and is.location_id=#{req.locationId}
</if>
<if test="req.property !=null and req.property !='all'">
and is.property=#{req.property}
</if>
GROUP BY
is.type_id,
is.type_name,
is.size_id,
is.size_name,
is.unit_price
<if test="req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
</select>
<select id="selectSumByItemsCount" resultType="java.lang.Integer"
parameterType="com.junmp.jyzb.api.bean.query.InventoryReq">
select count(*) from (
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} and i.state !="destory"
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.locationId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
</if>
<if test="req.locationState!='all' and req.locationState !=null and req.locationState!=''">
and i.location_state=#{req.locationState}
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
and wi.size_id=#{req.sizeId}
</if>
<if test="req.price !=null and req.price != ''">
and i.price=#{req.price}
</if>
<if test="req.warrantyPeriod != null and req.warrantyPeriod != ''">
and i.warranty_period=#{req.warrantyPeriod}
</if>
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
) as a
</select>
<select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
<<<<<<< HEAD
LEFT JOIN base_cabinet_box bcb ON i.location_id = bcb.id AND i.location_type = 1
LEFT JOIN base_cabinet bc ON bcb.cabinet_id = bc.id
LEFT JOIN base_warehouse bw ON i.location_id = bw.id AND i.location_type = 0
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId}
-- SELECT //修改后应该按照这个来
-- wi.type_id,
-- wi.size_id,
-- wi.shelf_id,
-- wi.shelf_location,
-- wi.epc,
-- wi.org_id,
-- wi.location_state,
-- wi.location_type,
-- wi.location_id,
-- i.id,
-- i.supplier_id,
-- i.price,
-- i.state,
-- i.bussiness_state,
-- i.production_date,
-- i.warranty_period,
-- i.maintenance_period,
-- i.term_state,
-- i.property,
-- i.area_id,
-- wi.type_name AS type_name,
-- wi.size_name AS size_name,
-- wi.org_name AS org_name,
-- bs.NAME AS supplier_name,
-- wi.location_name AS location_name
-- FROM
-- base_warehouse_inventory wi
-- LEFT JOIN base_inventory i ON i.epc = wi.epc
-- LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
=======
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} and i.state !="destory"
>>>>>>> 7952b8c429b94cc118c5a5dda061f62585a8cdda
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.locationId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
</if>
<if test="req.locationState!='all' and req.locationState !=null and req.locationState!=''">
and i.location_state=#{req.locationState}
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
and wi.size_id=#{req.sizeId}
</if>
<if test="req.price !=null and req.price != ''">
and i.price=#{req.price}
</if>
<if test="req.warrantyPeriod != null and req.warrantyPeriod != ''">
and i.warranty_period=#{req.warrantyPeriod}
</if>
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="selectOrgIds" resultType="java.lang.Long">
SELECT
`po`.`org_id` AS `org_id`
FROM `pub_org` `po`
WHERE `po`.`del_flag` = 1
and (po.org_id=#{orgId} or `po`.org_parent_id=#{orgId})
and `po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId} )+1
GROUP BY org_id
</select>
</mapper>
\ No newline at end of file
......@@ -57,6 +57,51 @@
GROUP BY months.month, years.year
ORDER BY year, month;
</select>
<select id="RecordSumByOrderId" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
SELECT
max(order_code) as order_code,
order_main_id,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( device_type, '' ))) AS device_type,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( user_name, '' ))) AS user_name,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( equipment_list, '' ))) AS equipment_list,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( location_name, '' ))) AS location_name,
bussiness_type,
out_in_state,
sum(number) as number
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
<if test="req.startTime != null and req.endTime != null">
and create_time>#{req.startTime} and create_time &lt; #{req.endTime}
</if>
and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
<if test="req.bussinessType != null and req.bussinessType != ''">
and bussiness_type =#{req.bussinessType}
</if>
<if test="req.locationName != null and req.locationName != ''">
and location_name like CONCAT('%', #{req.locationName}, '%')
</if>
<if test="req.locationId != null and req.locationId != ''">
and location_id =#{req.locationId}
</if>
<if test="req.typeName != null and req.typeName != ''">
and equipment_list like CONCAT('%', #{req.typeName}, '%')
</if>
<if test="req.userName != null and req.userName != ''">
and user_name like CONCAT('%', #{req.userName}, '%')
</if>
GROUP BY order_main_id,bussiness_type,out_in_state
<if test="req.column != 'create_time' and req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="ShowInOutRecords" resultType="com.junmp.jyzb.entity.LogSummary">
select ls.location_id,ls.use_time,ls.create_time,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
from base_log_summary ls
......@@ -74,6 +119,7 @@
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="ShowInOutRecordsSum" resultType="java.lang.Integer">
select count(*)
from (select ls.location_id,ls.use_time, ls.location_name, ls.bussiness_type, ls.out_in_state, ls.user_name, a.*
......@@ -128,49 +174,6 @@
</if>
) as a
</select>
<select id="RecordSumByOrderId" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
SELECT
max(order_code) as order_code,
order_main_id,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( device_type, '' ))) AS device_type,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( user_name, '' ))) AS user_name,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( equipment_list, '' ))) AS equipment_list,
GROUP_CONCAT(DISTINCT COALESCE (NULLIF( location_name, '' ))) AS location_name,
bussiness_type,
out_in_state,
sum(number) as number
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
and create_time>#{req.startTime} and create_time &lt; #{req.endTime} and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
<if test="req.bussinessType != null and req.bussinessType != ''">
and bussiness_type =#{req.bussinessType}
</if>
<if test="req.locationName != null and req.locationName != ''">
and location_name like CONCAT('%', #{req.locationName}, '%')
</if>
<if test="req.locationId != null and req.locationId != ''">
and location_id =#{req.locationId}
</if>
<if test="req.typeName != null and req.typeName != ''">
and equipment_list like CONCAT('%', #{req.typeName}, '%')
</if>
<if test="req.userName != null and req.userName != ''">
and user_name like CONCAT('%', #{req.userName}, '%')
</if>
GROUP BY order_main_id,bussiness_type,out_in_state
<if test="req.column != 'create_time' and req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="RecordSumByOrderIdSum" resultType="com.junmp.jyzb.api.bean.dto.LogSummaryDto">
select sum(number) as number,count(*) as count FROM (
SELECT
......@@ -186,7 +189,10 @@
FROM
base_log_summary
where (order_main_id is not null and order_main_id !='') and org_id=#{req.orgId}
and create_time>#{req.startTime} and create_time &lt; #{req.endTime} and location_type=0
<if test="req.startTime != null and req.endTime != null">
and create_time>#{req.startTime} and create_time &lt; #{req.endTime}
</if>
and location_type=0
<if test="req.outInState != null and req.outInState != ''">
and out_in_state =#{req.outInState}
</if>
......
......@@ -261,7 +261,7 @@ WHERE o.org_id IN
</select>
<select id="selectUserBypoliceIds" resultType="com.junmp.jyzb.api.bean.dto.PolicemanDto">
select b.* FROM(
select a.*, GROUP_CONCAT(sr.role_name SEPARATOR ',') AS role_name FROM (
select a.*, GROUP_CONCAT(sr.role_name SEPARATOR ',') AS roles_name FROM (
select
su.user_id,su.account,su.status_flag as state,suo.org_id,max(p.id) as id,
COALESCE(max(p.name),max(su.nick_name)) as name,
......
......@@ -383,16 +383,20 @@
<select id="getTotalPriceDetail" resultType="com.junmp.jyzb.api.bean.dto.TjDto.TjOrgPriceDto">
SELECT
t3.org_id,t3.org_code,t3.org_name,t3.d_name,
COALESCE ( t4.start_num, 0 ) AS start_num,
COALESCE ( t4.start_price, 0 ) AS start_price,
COALESCE ( t4.end_num, 0 ) AS end_num,
COALESCE ( t4.end_price, 0 ) AS end_price,
COALESCE ( t4.add_num, 0 ) AS add_num,
COALESCE ( t4.add_price, 0 ) AS add_price,
COALESCE ( t4.destory_num, 0 ) AS destory_num,
COALESCE ( t4.destory_price, 0 ) AS destory_price,
t4.type_id,t4.type_name
max(t3.org_id) as org_id,
max(t3.org_code) as org_code,
max(t3.org_name) as org_name,
max(t3.d_name) as d_name,
sum(COALESCE ( t4.start_num, 0 )) AS start_num,
sum(COALESCE ( t4.start_price, 0 )) AS start_price,
sum(COALESCE ( t4.end_num, 0 )) AS end_num,
sum(COALESCE ( t4.end_price, 0) ) AS end_price,
sum(COALESCE ( t4.add_num, 0 )) AS add_num,
sum(COALESCE ( t4.add_price, 0 )) AS add_price,
sum(COALESCE ( t4.destory_num, 0 )) AS destory_num,
sum(COALESCE ( t4.destory_price, 0 )) AS destory_price,
t4.type_id,
max(t4.type_name) as type_name
FROM
(
SELECT
......@@ -536,9 +540,13 @@
GROUP BY vpss.org_id_int, vpss.type_id, vpss.type_name
) AS t2 ON t1.org_id_int = t2.org_id_int AND t1.type_id = t2.type_id) AS t4
WHERE t3.org_id = t4.org_id_int
<if test="column != null and column != '' and order != null and order != '' ">
GROUP BY type_id
<if test="column != null ">
order by ${column} ${order}
</if>
<if test="column == null ">
order by type_id
</if>
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.VieDestroyGroupMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.VieDestoryGroup">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="sizeName" column="size_name" jdbcType="VARCHAR"/>
<result property="typeName" column="type_name" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="BIGINT"/>
<result property="countOfItems" column="count_of_items" jdbcType="VARCHAR"/>
<result property="warehouseId" column="warehouse_id" jdbcType="VARCHAR"/>
<result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,size_name,type_name,
state,size_id,type_id,
org_name,org_id,count_of_items,
warehouse_id,warehouse_name
</sql>
<select id="selectByTerms" resultType="com.junmp.jyzb.entity.VieDestoryGroup">
select * from vie_destory_group where (
<foreach collection="list" item="item" separator="or">
org_id =#{item.orgId} and size_id =#{item.sizeId} and type_id=#{item.typeId} and warehouse_id= #{item.warehouseId}
</foreach>
) and state="broken"
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.VieWarrantyGroupMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.VieWarrantyGroup">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="sizeName" column="size_name" jdbcType="VARCHAR"/>
<result property="typeName" column="type_name" jdbcType="VARCHAR"/>
<result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result property="days" column="days" jdbcType="INTEGER"/>
<result property="warrantyType" column="warranty_type" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="BIGINT"/>
<result property="countOfItems" column="count_of_items" jdbcType="VARCHAR"/>
<result property="warehouseId" column="warehouse_id" jdbcType="VARCHAR"/>
<result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,size_name,type_name,
size_id,type_id,days,
warranty_type,org_name,org_id,
count_of_items,warehouse_id,warehouse_name
</sql>
<select id="selectByTerms" resultType="com.junmp.jyzb.entity.VieWarrantyGroup">
select * from vie_warranty_group where (
<foreach collection="list" item="item" separator="or">
org_id =#{item.orgId} and size_id =#{item.sizeId} and type_id=#{item.typeId} and warehouse_id= #{item.warehouseId}
</foreach>
) and warranty_type=0
</select>
</mapper>
......@@ -36,7 +36,7 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
......
......@@ -33,7 +33,7 @@ spring:
virtual-host: /
profiles:
#@spring.active@
active: local
active: prod
servlet:
multipart:
max-request-size: 500MB
......
......@@ -83,6 +83,7 @@ import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import springfox.documentation.spring.web.json.Json;
import javax.annotation.Resource;
......@@ -117,6 +118,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
private QuickSuggestionsMapper quickSuggestionsMapper;
@Override
@Transactional
public ResponseResult agree(HandleDataDTO handleDataDTO) {
SysUser StartUser=new SysUser();
if (handleDataDTO.getCurrentUserInfo().getUserId()!=null)//优先拿接口中的信息,方便调试
......@@ -231,6 +233,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
@Override
@Transactional
public ResponseResult refuse(HandleDataDTO handleDataDTO) {
SysUser StartUser=new SysUser();
if (handleDataDTO.getCurrentUserInfo().getUserId()!=null)//优先拿接口中的信息,方便调试
......
......@@ -33,14 +33,14 @@
set om.examine_state ="refuse" where om.process_id =#{processId}
</update>
<update id="updateInventorySum">
<foreach collection="list" item="item" open="(" separator="," close=")">
update base_inventory_summary `is` set agent_broken_num={item.agentBrokenNum} where id=#{item.id}
<foreach collection="list" item="item" separator=";">
update base_inventory_summary set agent_broken_num=#{item.agentBrokenNum} where id=#{item.id}
</foreach>
</update>
<update id="updateDesNum">
<foreach collection="list" item="item" open="(" separator="," close=")">
update base_inventory_summary `is` set destruction_number={item.destructionNumber},
<foreach collection="list" item="item" separator=";" >
update base_inventory_summary set destruction_number=#{item.destructionNumber},
set number=#{item.number},set price=#{item.price}
where id=#{item.id}
</foreach>
......@@ -52,7 +52,7 @@
<select id="selectSumByItems" resultType="com.junmp.jyzb.api.bean.req.InventorySummaryReq">
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
broken_price,broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
from base_inventory_summary where
<foreach collection="list" item="item" separator="or">
(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论