Code Monkey home page Code Monkey logo

dibo-software / diboot Goto Github PK

View Code? Open in Web Editor NEW
1.4K 52.0 272.0 16.14 MB

写的更少, 性能更好 -> 为开发人员打造的低代码开发平台。mybatis-plus关联查询,关联无SQL,性能高10倍,前后端代码本地可视化生成,flowable工作流,spring cloud微服务等全方位赋能!

Home Page: https://www.diboot.com

License: Apache License 2.0

Java 69.65% Vue 15.78% JavaScript 0.06% SCSS 0.20% TypeScript 13.63% HTML 0.68%
spring-boot mybatis mybatis-plus spring-cloud flowable vue spring springboot low-code low-code-framework

diboot's People

Contributors

91chenxs avatar air-cooled avatar dependabot[bot] avatar dibocradle avatar godchao avatar jerryma1024 avatar loyea927 avatar scorrt-2021 avatar uucoding avatar wyldusername avatar zzemptypoint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diboot's Issues

[建议]关于远程绑定RemoteBindingManager的改进

获取RemoteBindingProvider的部分建议给一些扩展的机会,比如我不用openfeign用dubbo,这时候RemoteBindingProvider就不太能支持了。

比如改成这样

private synchronized static RemoteBindingProvider getRemoteBindingProvider(String module){
        if(MODULE_PROVIDER_MAP == null){
            MODULE_PROVIDER_MAP = new ConcurrentHashMap<>();
        }
        return MODULE_PROVIDER_MAP.computeIfAbsent(module, key -> {
            // ---------------- 之前 ----------------
            if(feignClientBuilder == null){
                feignClientBuilder = new FeignClientBuilder(ContextHelper.getApplicationContext());
            }
            return feignClientBuilder.forType(RemoteBindingProvider.class, module).build();
            // ---------------- 之后 ----------------
            RemoteBindingProviderFactory factory = ContextHelper.getApplicationContext().getBean(RemoteBindingProviderFactory.class);
            return factory.create(module);
        });
    }

这样diboot-core就不需要依赖openfeign,原来FeignClientBuilder那部分可以移到diboot-cloud那边

[建议] 关于老项目接入diboot

文档中提到

mybatis-plus老项目可以尝试依赖diboot-core并手动配置并实现字典绑定接口

请问能不能详细完善一下老项目接入指南,如果IService和Controller全部继承diboot的话代码改动好像挺大的

上传文件失效

在没有引入diboot之前,
@ApiOperation("文件上传")
@PostMapping("/upload")
public void upload(@ApiParam(name = "files", value = "文件", required = true) MultipartFile[] files) {
}
使用这个上传文件正常
O7DSPQTU57I5%KV@$ 036X

引入diboot-file依赖包,上传的方法获取到的files就为空字符串了
就无法上传了

生成的sql delete有问题

MyBaseEntity

@Data
public abstract class MyBaseEntity implements Serializable {
    private static final long serialVersionUID = 3766706110662091336L;

    @TableLogic
    @JsonIgnore
    @TableField(value = Cons.COLUMN_IS_DELETED, select = false)
    private boolean deleted = false;

    @TableField(
            insertStrategy = FieldStrategy.NEVER,
            updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime createTs;

    @TableField(
            insertStrategy = FieldStrategy.NEVER,
            updateStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime updateTs;


    @Version
    private Integer version;
}

n:n的 关联表

public class DbPurchaseRelPlanGoods extends MyBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "关联id")
    @TableId(value = "rel_id", type = IdType.ASSIGN_ID)
    private Long relId;

    @ApiModelProperty(value = "采购计划单id")
    private Long purchaseFormPlanId;

    @ApiModelProperty(value = "商品id")
    private Long goodsId;

query dto

@Data
public class PurchaseFormPlanQueryDto {
    @BindQuery(comparison = Comparison.EQ,
            entity=DbGoodsGoodsInfo.class, field="goods_nm",
            condition="this.purchase_form_plan_id" +
            "=tbl_purchase_rel_plan_goods.purchase_form_plan_id and " +
            "tbl_purchase_rel_plan_goods.goods_id=goods_id"
    )
    private String goodsNm;
}

测试代码

  @Test void testQueryPage(){
        var pfpQueryDto = new PurchaseFormPlanQueryDto();
        pfpQueryDto.setGoodsNm("abcd");
        QueryWrapper<DbPurchaseFormPlan> queryWrapper = QueryBuilder.toQueryWrapper(pfpQueryDto);
        // svc + DTO qw + Bo.class 查询 bo
        // bo必须要有所有this.xxx fields.
        // Invalid property 'purchaseFormPlanId' of bean class [club.walnuts.pms.data.bo.DbPurchaseFormPlanBo]
        Pagination pagination = new Pagination(1);
        pagination.setPageSize(10);

        // 前端传入total 缓存,本次不计算。
        // pagination.setTotalCount(100);
        // 默认asc, pagination.setOrderBy("orderBy=shortName:DESC,age:ASC,birthdate");
        pagination.setOrderBy("assigneeUsrId");

        // ### SQL: SELECT purchase_form_plan_id, goods_id FROM tbl_purchase_rel_plan_goods WHERE deleted = 0 AND (purchase_form_plan_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) AND tenant_id = 1
        //### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'deleted' in 'where clause'
        var p2 = dbPurchaseFormPlanSvc.getViewObjectList(queryWrapper, pagination, DbPurchaseFormPlanBo.class);
        return;
    }

有时是is_deleted,这时候是正确的

屏幕快照 2021-03-23 下午1 56 07

日志中有is_deleted

屏幕快照 2021-03-23 下午1 55 26

相同代码, 有时生成的是deleted, 这时就出错了。

屏幕快照 2021-03-23 下午4 22 48

日志中是deleted
屏幕快照 2021-03-23 下午4 22 36

[diboot 新手训练营]构建报错

环境:java8 || [email protected] || maven

按照 diboot 新手训练营

demo/src/main/resources/application.properties 配置数据库等参数后,构建报错:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.6:repackage (repackage) on project demo-common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.7.6:repackage failed: Unable to find main class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
  • 其中 3. 运行demo项目 也与实例不同
    image

无SQL关联绑定的问题

我看了一下打印的sql语句,发现@BindEntityList 1对多,多对多的时候其实并不是一条sql join的方式,而是分成几条SQL语句来查询。

用苞米豆的dynamic-datasource整合Diboot报错,貌似暂不支持动态数据源

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corePluginManager' defined in class path resource [com/diboot/core/starter/CoreAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.diboot.core.starter.CorePluginManager]: Factory method 'corePluginManager' threw exception; nested exception is com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: The jdbcUrl is Null, Cannot read database type

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.diboot.core.starter.CorePluginManager]: Factory method 'corePluginManager' threw exception; nested exception is com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: The jdbcUrl is Null, Cannot read database type

Caused by: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: The jdbcUrl is Null, Cannot read database type

新项目,默认用户表无法新建用户,没有进接口直接抛出NPE

新生成的项目,自己的表新建接口没问题,默认的用户表,新建用户接口断点没进去,直接抛出了NPE,这是为什么啊?参数没问题的

2021-12-01 18:13:25.159 DEBUG 18216 --- [nio-9090-exec-1] org.apache.tomcat.util.http.Parameters : Set encoding to UTF-8
2021-12-01 18:13:25.159 DEBUG 18216 --- [nio-9090-exec-1] o.s.web.servlet.DispatcherServlet : POST "/api/iam/user/", parameters={}
2021-12-01 18:13:25.159 DEBUG 18216 --- [nio-9090-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.example.demo.controller.iam.IamUserController#createEntityMapping(IamUserAccountDTO)
2021-12-01 18:13:25.160 DEBUG 18216 --- [nio-9090-exec-1] .m.m.a.ExceptionHandlerExceptionResolver : Using @ExceptionHandler com.example.demo.handler.GeneralExceptionHandler#handleException(HttpServletRequest, Exception)
2021-12-01 18:13:25.162 WARN 18216 --- [nio-9090-exec-1] c.d.c.handler.DefaultExceptionHandler : 请求处理异常

java.lang.NullPointerException: null
at org.springframework.core.log.LogFormatUtils.formatValue(LogFormatUtils.java:62) ~[spring-core-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.lambda$readWithMessageConverters$0(AbstractMessageConverterMethodArgumentResolver.java:212) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.core.log.LogFormatUtils.traceDebug(LogFormatUtils.java:86) ~[spring-core-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:211) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:160) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:133) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121) ~[spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:179) ~[spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:146) ~[spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.3.10.jar:5.3.10]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.3.10.jar:5.3.10]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) [tomcat-embed-core-9.0.53.jar:4.0.FR]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.3.10.jar:5.3.10]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [tomcat-embed-core-9.0.53.jar:4.0.FR]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:450) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.8.0.jar:1.8.0]
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.8.0.jar:1.8.0]
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387) [shiro-core-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.8.0.jar:1.8.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.3.10.jar:5.3.10]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.3.10.jar:5.3.10]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.3.10.jar:5.3.10]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.3.10.jar:5.3.10]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-embed-core-9.0.53.jar:9.0.53]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.53.jar:9.0.53]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_73]

使用BindEntityList中间表关联查询数据被覆盖问题

使用条件为 "this.precuring_product_id = pre_precuring_product.id AND pre_precuring_product.precuring_node_id = precuring_node_id"
本来应该有三条数据,但是最后结果只剩最后一条
https://sm.ms/image/dXyGMv8wgCFlrSa
执行到BeanUtils.convertToStringKeyObjectMap()这个方法时List内的数据被覆盖到只剩一条
https://sm.ms/image/ehz8x2OtkRXTMVY
方法内部的Map使用的是同一个key导致数据被覆盖
https://sm.ms/image/rDmxbQdw92WyL8k
请问这种情况该如何解决

idea 生成代码有问题

版本用的2.0.5,照着教程创建的项目。

出现的问题是 DemoController (生成的controller) extends BaseCrudRestController 被继承的BaseCrudRestController包没imoprt。手动导入后,重启项目,代码又还原到没有导包的状态,研究了一番无果。
相对应 Demo(entity) 继承的父类也没import
不知道哪出了问题,请帮助解决,谢谢!

entity中如果有localdatetime在copyproperty会失败

BeanUtils.convertValueToFieldType, 查到localdatetime含有date, 会转为date类型

       else if(type.contains(Date.class.getSimpleName())){
            return D.fuzzyConvert(S.valueOf(value));
        }

这里又无法将date value设置到localdatetime field.

    public static void setProperty(Object obj, String field, Object value) {
        BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(obj);
        wrapper.setPropertyValue(field, value);
    }

最终报错

[10:26:08:385] [WARN] - com.diboot.core.util.BeanUtils.bindProperties(BeanUtils.java:152) - 复制属性DbPurchaseFormPlan.expectArrivalTs异常: Failed to convert property value of type 'java.util.Date' to required type 'java.time.LocalDateTime' for property 'expectArrivalTs'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.util.Date' to required type 'java.time.LocalDateTime' for property 'expectArrivalTs': no matching editors or conversion strategy found

https://www.jianshu.com/p/826e73804989
建议对timestamp类型默认使用线程安全的LocalDateTime,或体提供convertValueToFieldType自定义配置。

获取对象属性值出错,返回null

升级2.3.1 之后报错 “获取对象属性值出错,返回null”,断点发现是 listvo 继承了实体,ContextHelper.getIdFieldName 获取主键时从缓存中(缓存只会缓存数据库对象实体)获取不到主键导致的,之前2.2没这个问题

关于查询结果返回联表+字典翻译

请问如果我的一个字段是联表返回的
再对这个字段进行字典翻译 我应该如何书写
现在这个是异步操作,在字典翻译的时候 联表查询的值还是空的

无法识别数据库类型,请检查配置!

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corePluginManager' defined in class path resource [com/diboot/core/starter/CoreAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.diboot.core.starter.CorePluginManager]: Factory method 'corePluginManager' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:484)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at io.renren.RenrenApplication.main(RenrenApplication.java:19)
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.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.diboot.core.starter.CorePluginManager]: Factory method 'corePluginManager' threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)
... 24 common frames omitted
Caused by: java.lang.NullPointerException: null
at com.diboot.core.starter.SqlHandler.buildPureSqlStatement(SqlHandler.java:124)
at com.diboot.core.starter.SqlHandler.checkIsTableExists(SqlHandler.java:67)
at com.diboot.core.starter.SqlHandler.checkIsDictionaryTableExists(SqlHandler.java:58)
at com.diboot.core.starter.CoreAutoConfiguration.corePluginManager(CoreAutoConfiguration.java:51)
at com.diboot.core.starter.CoreAutoConfiguration$$EnhancerBySpringCGLIB$$9c205ed7.CGLIB$corePluginManager$0()
at com.diboot.core.starter.CoreAutoConfiguration$$EnhancerBySpringCGLIB$$9c205ed7$$FastClassBySpringCGLIB$$f2935f60.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
at com.diboot.core.starter.CoreAutoConfiguration$$EnhancerBySpringCGLIB$$9c205ed7.corePluginManager()
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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 25 common frames omitted

bindcount问题

统计结果还是不对,列表十条数据,分组cout结果是9条,count漏掉的那条count值还是设置为null了不是0

BindField的字段无法从Timestamp转为LocalDateTime

与直接非bindfield的字段行为不一致.

代码

  @BindField(entity = DbWarehouseGoodsbatch.class, field="manufactureTs", condition="this.goodsbatch_id=id")
    private LocalDateTime manufactureTs;

报错:

Cannot convert value of type 'java.sql.Timestamp' to required type 'java.tim

stack:

convertIfNecessary:119, TypeConverterDelegate (org.springframework.beans)
convertIfNecessary:588, AbstractNestablePropertyAccessor (org.springframework.beans)
convertForProperty:607, AbstractNestablePropertyAccessor (org.springframework.beans)
processLocalProperty:456, AbstractNestablePropertyAccessor (org.springframework.beans)
setPropertyValue:278, AbstractNestablePropertyAccessor (org.springframework.beans)
setPropertyValue:246, AbstractNestablePropertyAccessor (org.springframework.beans)
setProperty:197, BeanUtils (com.diboot.core.util)
setFieldValueToTrunkObj:157, FieldBinder (com.diboot.core.binding.binder)
bind:110, FieldBinder (com.diboot.core.binding.binder)
parseConditionsAndBinding:293, RelationsBinder (com.diboot.core.binding)
doBindingField:218, RelationsBinder (com.diboot.core.binding)
bind:130, RelationsBinder (com.diboot.core.binding)
bind:102, RelationsBinder (com.diboot.core.binding)
convertAndBind:79, RelationsBinder (com.diboot.core.binding)
convertAndBindRelations:85, Binder (com.diboot.core.binding)
getViewObjectList:649, BaseServiceImpl (com.diboot.core.service.impl)
pageQuery:43, MyBaseService (club.walnuts.platform.data.base)
invoke:-1, MyBaseService$$FastClassBySpringCGLIB$$1 (club.walnuts.platform.data.base)
invoke:218, MethodProxy (org.springframework.cglib.proxy)
intercept:688, CglibAopProxy$DynamicAdvisedInterceptor (org.springframework.aop.framework)
pageQuery:-1, DbDeliveryFormOutWarehouseRelGoodsSvcImpl$$EnhancerBySpringCGLIB$$1 (club.walnuts.platform.data.dibootautogen.service.impl)
queryGbRecExcel:189, DeliveryFormOutController (club.walnuts.pms.controllers.delivery)

直接用, 没bindfield的可以成功转换.

    private LocalDateTime createTime;

com.diboot.core.util.BeanUtils:

    public static void setProperty(Object obj, String field, Object value) {
        BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(obj);
        wrapper.setPropertyValue(field, value);
    }

需要两个改进:

  1. 应该用spring jdbc的默认converter(不太确定, 或者是mybatis的), 可以使bindfield和直接用的行为一致.
  2. 这里需要提供可以供用户定制Converter的方法.

BindCount bug

实体设置了统计字段

@TableField(exist = false)
@BindCount(entity = Dept.class, condition = "this.id=parent_id")
@ApiModelProperty("社区小区数量")
private Long childrenCount = 0L;

全局配置了数字为null返回-1,结果发现某页有一条统计大于0的数据时本该统计为0的列统计值都是-1。断点跟踪发现是ResultAssembler 101行 beanWrapper.setPropertyValue(setterFieldName, matchedValues); matchedValues值是list,类型不匹配导致赋值覆盖为null了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.